Pull up a chair!
Discussions is your place to get to know your peers, tackle the bigger challenges together, and have fun along the way.
- Want to see the latest updates? Follow the Highlights!
- Looking for techniques improve your MATLAB or Simulink skills? Tips & Tricks has you covered!
- Sharing the perfect math joke, pun, or meme? Look no further than Fun!
- Think there's a channel we need? Tell us more in Ideas
Updated Discussions
- I already did it successfully twice in the past for my previous groups ;
- If you take one problem specifically, Problem 60984. Mesh the icosahedron for instance, you can normally see the icon of the cover image in the top right hand corner, can't you ?
- I always manage to set cover images to my contributions (mostly in the filexchange).
- x is the position or displacement of the object relative to the reference point.
- v is the velocity.
- m is the mass.
- p is the linear momentum, calculated by p = m × v.
- dm/dt is the rate of mass change over time.
- NKTg₁ is the quantity representing the product of position and momentum.
- NKTg₂ is the quantity representing the product of mass variation and momentum.
- The unit of measurement is NKTm, representing a unit of varying inertia.
- If NKTg₁ is positive, the object tends to move away from the stable state.
- If NKTg₁ is negative, the object tends to move toward the stable state.
- If NKTg₂ is positive, the mass variation has a supporting effect on the movement.
- If NKTg₂ is negative, the mass variation has a resisting effect on the movement.
- Real-time planetary mass estimation using (x, v) data.
- Integration into orbital mechanics simulations in MATLAB.
- Potential extensions into astrophysics and engineering models.
- Data-driven planetary modeling in MATLAB.
- Improved sensitivity in detecting small-scale variations not included in standard NASA datasets.
- NASA JPL Horizons (planetary positions & velocities)
- NASA Planetary Fact Sheet (official masses)
- GRACE / GRACE-FO Mission Data (Earth mass loss)
- How to integrate the NKTg model into MATLAB orbital simulations.
- Whether conserved quantities like NKTg1 could provide practical value beyond astronomy (e.g., physics simulations, engineering).
- Verify interpolation of planetary masses using NKTg law.
- Compare with NASA real-time data (31/12/2024).
- Test sensitivity with Earth’s mass loss (NASA GRACE).
- All 8 planets’ interpolated masses match NASA values almost perfectly.
- Deviation (Delta_m) ≈ 0 → error < 0.0001%.
- Confirms that NKTg1 is conserved across planetary orbits.
- GRACE missions show Earth loses mass annually (10^20 – 10^21 kg/year).
- NKTg interpolation detects Δm ≈ 3 × 10^19 kg.
- This matches the lower bound of NASA’s measured range.
- NKTg₁ interpolation is extremely accurate for planetary masses.
- Planetary data can be reconstructed with negligible error.
- NKTg model is sensitive enough to capture Earth’s small annual mass loss.
- NKTg₁ = x·p (Position–Momentum interaction)
- NKTg₂ = (dm/dt)·p (Mass-variation–Momentum interaction)
- From NKTg₁: [M⋅L2/T][M·L²/T][M⋅L2/T]
- From NKTg₂: [M2⋅L/T2][M²·L/T²][M2⋅L/T2]
- Position (x): 4.498×1094.498 \times 10^94.498×109 km
- Velocity (v): 5.43 km/s
- Mass (m): 1.0243×10261.0243 \times 10^{26}1.0243×1026 kg
- Momentum (p = m·v): 5.564×10265.564 \times 10^{26}5.564×1026 kg·m/s
- NKTg₁ = x·p ≈ 2.503 × 10³⁶ NKTm
- NKTg₂ ≈ -1.113 × 10²² NKTm (assumed micro gas escape)
- Total NKTg ≈ 2.501 × 10³⁶ NKTm
- Astronomy: describe planetary mass variation, star/galaxy formation, and long-term orbital stability.
- Aerospace: optimize rocket fuel usage, account for mass leakage, design ion/plasma engines.
- Earth sciences: analyze GRACE-FO data, model ice melting, sea-level rise, and mass redistribution.
- Engineering: variable-mass robotics, cargo systems, vibration analysis, fluid/particle simulations.
- Establishes a new fundamental unit (NKTm), independent of Newton and Joule.
- Provides a theoretical framework for variable-mass dynamics, beyond Newton and Einstein.
- Supports accurate computation and simulation of real-world systems with mass variation.

- Which one is your favorite?
- Which ones do you want to add to your collection?
The functionality would allow report generation straight from live scripts that could be shared without exposing the code. This could be useful for cases where the recipient of the report only cares about the results and not the code details, or when the methodology is part of a company know how, e.g. Engineering services companies.
In order for it to be practical for use it would also require that variable values could be inserted into the text blocks, e.g. #var_name# would insert the value of the variable "var_name" and possibly selecting which code blocks to be hidden.



Add a subtitle
Multi-lined titles have been supported for a long time but starting in r2020b, you can add a subtitle with its own independent properties to a plot in two easy ways.
- Use the new subtitle function: s=subtitle('mySubtitle')
- Use the new second argument to the title function: [t,s]=title('myTitle','mySubtitle')

figure() tiledlayout(2,2)
% Method 1 ax(1) = nexttile; th(1) = title('Pupil size'); sh(1) = subtitle('Happy faces');
ax(2) = nexttile; th(2) = title('Pupil size'); sh(2) = subtitle('Sad faces');
% Method 2 ax(3) = nexttile; [th(3), sh(3)] = title('Fixation duration', 'Happy faces');
ax(4) = nexttile; [th(4), sh(4)] = title('Fixation duration', 'Sad faces');
set(ax, 'xticklabel', [], 'yticklabel', [],'xlim',[0,1],'ylim',[0,1])
% Set all title colors to orange and subtitles colors to purple. set(th, 'Color', [0.84314, 0.53333, 0.1451]) set(sh, 'Color', [0, 0.27843, 0.56078])
Control title/Label alignment
Title and axis label positions can be changed via their Position, VerticalAlignment and HorizontalAlignment properties but this is usually clumsy and leads to other problems when trying to align the title or labels with an axis edge. For example, when the position units are set to 'data' and the axis limits change, the corresponding axis label will change position relative to the axis edges. If units are normalized and the axis position or size changes, the corresponding label will no longer maintain its relative position to the axis, and that's assuming the normalized position was computed correctly in the first place.
Starting in r2020b, title and axis label alignment can be set to center|left|right, relative to the axis edges.
- TitleHorizontalAlignment is a property of the axis: h.TitleHorizontalAlignment='left';
- LabelHorizontalAlignment is a property of the ruler object that defines the x | y | z axis: h.XAxis.LabelHorizontalAlignment='left';

% Create data x = randi(50,1,100)'; y = x.*[.2, -.2] + (rand(numel(x),2)-.5)*10; gray = [.65 .65 .65];
% Plot comparison between columns of y figure() tiledlayout(2,2,'TileSpacing','none') ax(1) = nexttile(1); plot(x, y(:,1), 'o', 'color', gray) lsline ylabel('Y1 (units)') title('Regression','Y1 & Y2 separately')
ax(2) = nexttile(3); plot(x, y(:,2), 'd', 'color', gray) lsline xlabel('X Label (units)') ylabel('Y2 (units)') grid(ax, 'on') linkaxes(ax, 'x')
% Move title and labels leftward set(ax, 'TitleHorizontalAlignment', 'left') set([ax.XAxis], 'LabelHorizontalAlignment', 'left') set([ax.YAxis], 'LabelHorizontalAlignment', 'left')
% Combine the two comparisons into plot and flip the second % y-axis so trend are in the same direction ax(3) = nexttile([2,1]); yyaxis('left') plot(x, y(:,1), 'o') ylim([-6,16]) lsline xlabel('X Label (units)') ylabel('Y1 (units) \rightarrow')
yyaxis('right') plot(x, y(:,2), 'd') ylim([-16,6]) lsline ylabel('\leftarrow Y2 (units)') title('Direct comparison','(Y2 axis flipped)') set(ax(3), 'YDir','Reverse')
% Align the ylabels with the minimum axis limit to emphasize the % directions of each axis. Keep the title and xlabel centered ax(3).YAxis(1).LabelHorizontalAlignment = 'left'; ax(3).YAxis(2).LabelHorizontalAlignment = 'right'; ax(3).TitleHorizontalAlignment = 'Center'; % not needed; default value. ax(3).XAxis.LabelHorizontalAlignment = 'Center'; % not needed; default value.
About Discussions
Get to know your peers while sharing all the tricks you've learned, ideas you've had, or even your latest vacation photos. Discussions is where MATLAB users connect!
More Community Areas
Ask & Answer questions about MATLAB & Simulink!
Download or contribute user-submitted code!
Solve problem groups, learn MATLAB & earn badges!
Get the inside view on MATLAB and Simulink!
Use AI to generate initial draft MATLAB code, and answer questions!