David
David
Last activity on 15 Jul 2024

Hello and a warm welcome to all! We're thrilled to have you visit our community. MATLAB Central is a place for learning, sharing, and connecting with others who share your passion for MATLAB and Simulink. To ensure you have the best experience, here are some tips to get you started:
  1. Read the Community Guidelines: Understanding our community standards is crucial. Please take a moment to familiarize yourself with them. Keep in mind that posts not adhering to these guidelines may be flagged by moderators or other community members.
  2. Ask Technical Questions at MATLAB Answers: If you have questions related to MathWorks products, head over to MATLAB Answers (new question form - Ask the community). It's the go-to spot for technical inquiries, with responses often provided within an hour, depending on the complexity of the question and volunteer availability. To increase your chances of a speedy reply, check out our tips on how to craft a good question (link to post on asking good questions).
  3. Choosing the Right Channel: We offer a variety of discussion channels tailored to different contexts. Select the one that best fits your post. If you're unsure, the General channel is always a safe bet. If you feel there's a need for a new channel, we encourage you to suggest it in the Ideas channel.
  4. Reporting Issues: If you encounter posts that violate our guidelines, please use the 🚩Flag/Report feature (found in the 3-dot menu) to bring them to our attention.
  5. Quality Control: We strive to maintain a high standard of discussion. Accounts that post spam or too much nonsense may be subject to moderation, which can include temporary suspensions or permanent bans.
  6. Share Your Ideas: Your feedback is invaluable. If you have suggestions on how we can improve the community or MathWorks products, the Ideas channel is the perfect place to voice your thoughts.
Enjoy yourself and have fun! We're committed to fostering a supportive and educational environment. Dive into discussions, share your expertise, and grow your knowledge. We're excited to see what you'll contribute to the community!
Hello everyone,
I would like to share some results from my recent research on the NKTg law of variable inertia and how it was experimentally verified using NASA JPL Horizons data (Dec 30–31, 2024).
🔹 What is the NKTg Law?
The law states that an object’s tendency of motion depends on the interaction between its position (x), velocity (v), and mass (m) through the conserved quantity:
NKTg1 = x * (m * v)
Here, m * v is the linear momentum.
If NKTg1 > 0 → the object tends to move away from equilibrium.
If NKTg1 < 0 → the object tends to return to equilibrium.
This law provides a new framework for analyzing orbital dynamics.
🔹 Research Objective
Interpolate the masses of all 8 planets using the NKTg law.
Compare results with NASA’s official planetary masses on 31/12/2024.
Test sensitivity for Earth’s mass loss as measured by GRACE / GRACE-FO missions.
🔹 Key Results
Table 1 – Mass Interpolation (31/12/2024)
Planet Interpolated Mass (kg) NASA Mass (kg) Δm Remarks
Mercury 3.301×10^23 3.301×10^23 ≈0 Perfect match
Venus 4.867×10^24 4.867×10^24 ≈0 Negligible error
Earth 5.972×10^24 5.972×10^24 ≈0 GRACE confirms slight variation
Mars 6.417×10^23 6.417×10^23 ≈0 Perfect match
Jupiter 1.898×10^27 1.898×10^27 ≈0 Stable mass
Saturn 5.683×10^26 5.683×10^26 ≈0 Error ≈ zero
Uranus 8.681×10^25 8.681×10^25 ≈0 Matches Voyager 2 data
Neptune 1.024×10^26 1.024×10^26 ≈0 Perfect match
Error rate: < 0.0001% across all planets.
🔹 Earth’s Mass Variation
NASA keeps Earth’s mass constant in official datasets.
GRACE/GRACE-FO show Earth loses ~10^20–10^21 kg annually (gas escape, ice melt, groundwater loss).
NKTg interpolation detected a slight decrease (~3 × 10^19 kg in 2024), which is within GRACE’s measured range.
This demonstrates the sensitivity of the NKTg model in detecting subtle real-world changes.
🔹 Why This Matters
Accuracy: NKTg interpolation perfectly matched NASA’s planetary masses.
Conservation: NKTg1 appears to be a conserved orbital quantity across both rocky and gas planets.
Applications:
  • Real-time planetary mass estimation using (x, v) data.
  • Integration into orbital mechanics simulations in MATLAB.
  • Potential extensions into astrophysics and engineering models.
🔹 Conclusion
The NKTg law provides a novel way to interpolate planetary masses with extremely high accuracy, while also being sensitive to subtle physical changes like Earth’s gradual mass loss.
This could open up new opportunities for:
  • Data-driven planetary modeling in MATLAB.
  • Improved sensitivity in detecting small-scale variations not included in standard NASA datasets.
References:
  • NASA JPL Horizons (planetary positions & velocities)
  • NASA Planetary Fact Sheet (official masses)
  • GRACE / GRACE-FO Mission Data (Earth mass loss)
  • 📂 Full paper (with detailed tables & methodology): [Provide your link – e.g. Google Drive, ResearchGate, or GitHub]
I’d be very interested in hearing thoughts from the community about:
  • 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).
Best regards,
Nguyen Khanh Tung
David
David
Last activity on 29 Aug 2025 at 20:21

I’d like to take a moment to highlight the great contributions of one of our community members, @Paul, who is fast approaching an impressive 5,000 reputation points!
Paul has built his reputation the best way possible - by generously sharing his knowledge and helping others. Over the last few years, he’s provided thoughtful and practical answers to hundreds of questions, making life a little easier for learners and experts alike.
Reputation points are more than just numbers here - they represent the trust and appreciation of the community. Paul’s upcoming milestone is a testament to his consistency, expertise, and willingness to support others.
Please join me in recognizing Paul's contributions and impact on the MATLAB Central community.
Nicolas Douillet
Nicolas Douillet
Last activity on 28 Aug 2025 at 13:48

I just wanted here to share a link to some .gif animations I created over the years with Matlab :-)
I think gif animations are great supports for scientific diffusion.
Just check my file exchange to find -and why not custom / improve- some of them ;-)
In our large open-source MATLAB Central community, there are many long-term excellent user groups. I really want to know why you have been using MATLAB for a long time, and what are its absolute advantages?
I have been using MATLAB for a long time, and there are several reasons for that:
  1. Fast ramp-up in unfamiliar domains: When I explore an unfamiliar application area or a new topic, MATLAB helps me quickly locate the canonical methods and example workflows. Its comprehensive, professional documentation — along with the related-topic links typically provided at the end of each page — makes it easy to get started intuitively and saves a lot of time that would otherwise be spent hunting for foundational knowledge across the web.
  2. A relatively cutting-edge yet reliable technical path: MATLAB’s many toolboxes evolve with the field. While updates aren’t always absolutely bleeding-edge, they generally offer approaches that balance modernity and proven reliability. This reduces the risk of wasting time on obscure or unstable algorithms and helps me follow a pragmatic, well-tested technical direction.
  3. Strong community and technical support: When I encounter a problem I first post on forums like MATLAB Answers and thoroughly investigate the issue myself. If I find a solution, I publish it to contribute back — which deepens my own understanding and helps others. If I can’t solve it alone, experienced community members often respond within hours. As a last resort, MathWorks’ official support is available and typically conducts an in-depth investigation into specific cases to help resolve the issue.
  4. ......
Also, most individuals have limited time and technical bandwidth, diving deeply into a single, narrow area can be hard to pull back from unless you are committed to that specific direction. For cutting‑edge, highly specialized research it’s often necessary to combine MATLAB with other languages (e.g., Python, C/C++) to go further.
Matt Nickels
Matt Nickels
Last activity on 22 Aug 2025 at 22:15

I can not understand why Plot Browser was taken away in latest Matlab... I use Plot Browser all of the time! Having to find and click the particular line I want in a plot with a lot of lines is way less convenient than just selecting it in the Plot Browser. Also, being able to quickly hide/show multiple lines at once with the plot browser was so helpful in a lot of cases. Please bring Plot Browser back!!!! Please reply with support for this if you feel the same as I do!
I don't like the change
16%
I really don't like the change
29%
I'm okay with the change
24%
I love the change
11%
I'm indifferent
11%
I want both the web & help browser
11%
38 votes

In the latest Graphics and App Building blog article, documentation writer Jasmine Poppick modernized a figure-based bridge analysis app by replacing uicontrol with new UI components and uifigure, resulting in cleaner code, better layouts, and expanded functionality in R2025a.

https://blogs.mathworks.com/graphics-and-apps/2025/08/19/__from-uicontrol-to-ui-components

This article covers the following topics:

Why and when to move from uicontrol and figure to modern UI components and uifigure.

How to replace uicontrol objects with equivalent UI component functions (uicheckbox, uidropdown, uispinner, etc.).

How to update callback code to match new component properties and behaviors.

How to adopt new UI component types (like spinners) to simplify validation and improve usability.

How to configure existing components with modern options (sortable tables, auto-fitting columns, editable data).

How to apply visual styling with uistyle and addStyle to make apps more user-friendly.

How to use uigridlayout to create flexible, adaptive layouts instead of manually managing positions.

The benefits of switching from figure to uifigure for app-building workflows.

A full before-and-after example of modernizing an existing app with incremental, practical updates.

There is a communication regarding "How can I set the text font style of a Data Cursor object interactively on a plot?". But I am not clear on the answer found in this link:
https://www.mathworks.com/matlabcentral/answers/95968-how-can-i-set-the-text-font-style-of-a-data-cursor-object
I do not know how and where to put the recommended commands. Would you please clarfity and give me more details?
Thank you.
David
David
Last activity on 14 Aug 2025 at 14:07

Worth the wait: seven new online training courses and one new learning path were released with 25a, covering topics in Controls, Electrification, and Physical Modeling. This release also brings new functionality to support interactions across both MATLAB and Simulink within a single course, beginning with the new Controls courses below:
This just came out. @Michelle Hirsch spoke to Jousef Murad and answer his questions about the big change in the desktop in R2025a and explained what was going on behind the scene. Enjoy!
The Big MATLAB Update: Dark Mode, Cloud & the Future of Engineering - Michelle Hirsch
I'm introducing the NKTg Law, a concise model describing how an object's motion tendency depends on position (x), velocity (v), and mass (m).
Definition:
NKTg = f(x, v, m)
Key quantities:
  • NKTg₁ = x * p
  • NKTg₂ = (dm/dt) * p
where p = m * v and dm/dt is the time rate of mass change.
Interpretation:
  • NKTg₁ > 0 → tendency to move away from equilibrium
  • NKTg₁ < 0 → tendency to move toward equilibrium
  • NKTg₂ > 0 → mass variation supports motion
  • NKTg₂ < 0 → mass variation resists motion
Stable state: when x, v and m interact to preserve the motion structure.
Would you like a ready-to-run MATLAB script / Live Script to simulate and plot NKTg₁ and NKTg₂?
These got released last week and the process for using them on your local machine with MATLAB is very similar to how you use the local deepseek models as I demonstrated in my February blog post How to run local DeepSeek models and use them with MATLAB » The MATLAB Blog - MATLAB & Simulink
You need Ollama and the LLMs with MATLAB package installed (Details on how to do this in the blog post above). Then you run the following in your operating systems' command line
ollama pull gpt-oss:20b
Over to MATLAB and set up a chat session
>> chat = ollamaChat("gpt-oss:20b")
chat =
ollamaChat with properties:
ModelName: "gpt-oss:20b"
Endpoint: "127.0.0.1:11434"
TopK: Inf
MinP: 0
TailFreeSamplingZ: 1
Temperature: 1
TopP: 1
StopSequences: [0×0 string]
TimeOut: 120
SystemPrompt: []
ResponseFormat: "text"
FunctionNames: []
txt = generate(chat,"Who are you?")
txt =
"I’m ChatGPT – a conversational AI developed by OpenAI. My core is the GPT‑4 language model, which has been trained on a massive mix of text from books, websites, articles and other sources to understand and generate human‑like language. I don’t have feelings, consciousness, or a personal identity; I’m a tool that can help answer questions, brainstorm ideas, explain concepts, draft text, and more. My goal is to understand the context you give me and respond in a helpful, accurate and safe way. If there’s something specific you’d like to know or do, just let me know!"
This is the smaller of the two, new open models and it is bringing my aging desktop to its knees. My GPU is too small to do the work so I think everything is happening on the CPU and its slooooow. Will try on my Mac next
Let me know if you try this out!
Long before I joined MathWorks, I was a member of the academic Research Software Engineering (RSE) community where part of my mission was to introduce basic software engineering concepts to the research community. Things like version control, testing and even simply writing code instead of using only pointy-clicky GUIs before copying and pasting the results plot into a word document. I've seen things..........*shudders*
The RSE movement is still going very strong and I am elated that MathWorks is increasingly interacting with it. One example of such interaction is a video tutorial contributed by my colleauge @Mihaela Jarema to a comminity seminar series called 'A summer of Testing' It's linked to below
The video assumes you've never run a test before and gently guides you through the principles. Along the way you'll learn about some of MATLAB's superb testing capabilities. Things like
  • Unit testing Framework
  • Test Browser App
  • Code Coverage
  • Test Fixtures (Setup and teardown)
  • Test driven devellopment
  • Function argument validation
  • CI/CD using GitHub actions
Go check out out.
I have started a blog series on the history of image display in MATLAB. If this topic interests you, and if there is something in particular you would like me to address in the series, let me know.
Hello to all!
I would like to share with the Matlab and Simulink community this video about Neural Networks in Simulink.
This is a series of videos that use a multilayer perceptron implemented in Simulink as a case study. Why Simulink? Because it's a visual and intuitive modeling tool, you can see the forward propagation of this network and better understand the flow. The objective of this series is to show the implementation using Simulink for both simulation and Arduino, as well as its training using Matlab and Matlab with Deep Learning Toolbox, and a video of training with Python.
The video is in Spanish, but the Simulink model is available in English for the entire community; subtitles are also available.
The files are located in the first comment of each video. We hope you find it interesting and enjoyable. Best regards!
Here I share the link to the first video.
In case you missed it in my overview of the MATLAB R2025a release, Markdown support has been greatly improved. This picture says it all
Walter Roberson
Walter Roberson
Last activity on 31 Jul 2025

This topic is for discussing highlights to the current R2025a Pre-release.
In many parts of Africa, particularly in technical universities and engineering institutes, physical laboratories are scarce or poorly equipped. This reality deeply limits the hands-on experience students deserve, especially in fields like control systems, signal processing, power electronics, and fluid mechanics.
But MATLAB and Simulink can fill part of this gap.
As an educator and researcher, I’ve made it my mission to promote MATLAB as a didactic simulation environment that brings real-world experimentation into the virtual space—affordable, accessible, and scalable. Whether simulating dynamic systems, visualizing electromagnetic fields, or tuning PID controllers interactively, students can develop strong intuition without needing costly hardware.
🔧 I’ve used MATLAB to teach:
  • Power systems and control theory without needing real generators or oscilloscopes,
  • Hydrology and environmental modeling without field sensors,
  • Robotics and AI concepts even where no robot is available.
🌍 This is more than a tool for me. It’s a bridge between educational ambition and limited infrastructure.
I dream of creating MATLAB-based virtual laboratories across African institutions. And I know I’m not alone.
Is anyone else here working on similar goals in under-resourced regions? Let’s connect and make it real.
— Patrick K.N.

About General

Discuss a wide range of MATLAB topics and share your thoughts and opinions with other community members.

This is the channel to post to if your topic doesn't fit any other channel contexts.

All technical questions
Community Guidelines MATLAB FAQs