搜索
Have you ever learned that something you were doing manually in MATLAB was already possible using a built-in feature? Have you ever written a function only to later realize (or be told) that a built-in function already did what you needed?
Two such moments come to mind for me.
1. Did you realize that you can set conditional breakpoints? Neither did I, until someone showed me that feature. To do that, open or create a file in the editor, right click on a line number for any line that contains code, and select Set Conditional Breakpoint... This will bring up a dialog wherein you can type any logical condition for which execution should be paused. Before I learned about this, I would manually insert if-statements during debugging. Then, after fixing each bug, I would have to delete those statements. This built-in feature is so much better.
2. Have you ever needed to plot horizontal or vertical lines in a plot? For the longest time, I would manually code such lines. Then, I learned about xline() and yline(). Not only is less code required, these lines automatically span the entire axes while zooming, panning, or adjusting axis limits!
Share your own Aha! moments below. This will help everyone learn about MATLAB functionality that may not be obvious or front and center.
(Note: While File Exchange contains many great contributions, the intent of this thread is to focus on built-in MATLAB functionality.)
I am an Automation Engineering student and I work extensively with algorithms using controllers. However, I am not very familiar with embedded systems. I noticed that there is a support package for STM32 boards in the Add-on tab.
Although I saw that it should support STM32WBxx, when I installed it, it appeared to be unavailable. Can anyone provide me with advice or a solution on how to implement my algorithms on this STM32WB55 board?
Thank you so much!

Hi
I am wokin on the transfer fuction block to model the dyamic syatem of the aircraft. But durin the modeling i have noticed that there is no sample time space to enter the value.
How can I enter the sample time in the discrete transfer fucntion block.
The carot symbol on my keyboard (ˆ shift+6) doesn't work on matlab. Matlab doesn't recognize it so I can't write any equation with power symbol. I tried every possible solution on the web and it doesn't work. even in the character viewer I don't have any result when I search ''caret".
Exciting news for students! 🚀Simulink Student Challenge 2023 is live! Unleash your engineering skills and compete for exciting rewards. Submission deadline is December 12th, 2023!

I want to design a continouos variable transmission that can be controlled using a PID controller. the one i have designed is giving errors. can anyone help?
Over the weekend I came across a pi approximation using durations of years and weeks (image below, Wolfram, eq. 89), accurate to 6 digits using the average Gregorian year (365.2425 days).

Here it is in MATLAB. I divided by 1 week at the end rather than multiplying by its reciprocal because you can’t divide a numeric by a duration in MATLAB (1/week).
weeks = @(n)n*days(7);
piApprox = ((years(13)-weeks(6))/years(13) + weeks(3)) / weeks(1)
% piApprox = 3.141593493469302
Here’s a breakdown
- The first argument becomes 12.885 yrs / 13 yrs or 0.99115
- Add three weeks: 0.99115 + 3 weeks = 21.991 days
- The reduced fraction becomes 21.991 days / 7 days
Now it looks a lot closer to the more familiar approximation for pi 22/7 but with greater precision!
Need help about FPGA Based VSC HVDC Real Time Simulation Model.
This person used computer version to build a keyboard input, and used standard flag semaphore for the positions.
Flag semaphore is used mostly by sailors to be able to communicate optically over a distance; it does not need anything more than make-shift flags (but binoculars or telescopes can help.) Trained users can go faster than you might guess.
Chen, Rena, and I are at a community management event. It's great to be with others talking about relationships, trust, and co-creation.
I have toruble setting up back to back test for one of the reference Model in Autosar component.
Getting such error
An error occurred ('RTW:makertw:makeHookError') when calling 'sim':
The call to autosar_make_rtw_hook, during the entry hook generated the following error: Model 'BsdTrvlSigProc' references Interface Dictionary 'BsdInterfaces.sldd'. However, the AUTOSAR properties in the model are not properly linked to the Interface Dictionary. Delete and create a new AUTOSAR mapping for the model. The build process will terminate as a result.
Model 'BsdTrvlSigProc' references Interface Dictionary 'BsdInterfaces.sldd'. However, the AUTOSAR properties in the model are not properly linked to the Interface Dictionary. Delete and create a new AUTOSAR mapping for the model.
I tried deleting and creating new one. Since this reference model inside AUTOSAR component, I would expect configuration to be taken from top Interfaces.sldd
Please give me some hint.
I'm in a community conference in Boston today and see what snacks we get! The organizer said it's a coincidence, but it's definitly a good idea to have them in our MathWorks community meetings.

A research team found a way to trick a number of AI systems by injecting carefully placed nonsense -- for example being able able to beat DeepMind's Go game.
This video discusses the "Cody" bridge, which is a pedestrian bridge over a canal that has been designed to move up and out of the way when ships need to travel through. The mathematics of the bridge movement are discussed and diagrammed. It is unique and educational.
Recently developed: a "microscope" based on touch and stereo vision.
Using touch removes the possibility of optical confusion -- for example, black on touch is only due to shape, not due to the possibility that the object has a black patch.
Sorry, you might need a Facebook account to watch the video.

(Sorry - it should be 2023b by now.)
spy

I'm curious how the community uses the hold command when creating charts and graphics in MATLAB. In short, hold on sets up the axes to add new objects to the axes while hold off sets up the axes to reset when new objects are added.
When you use hold on do you always follow up with hold off? What's your reasoning on this decision?
Can't wait to discuss this here! I'd love to hear from newbies and experts alike!
Calling all students! New to MATLAB or need helpful resources? Check out our MATLAB GitHub for Students repository! Find MATLAB examples, videos, cheat sheets, and more!

Visit the repository here: MATLAB GitHub for Students
Imagine x is a large vector and you want the smallest 10 elements. How might you do it?
