An open exchange for the MATLAB and Simulink user community
A minimum length 2D planar bell nozzle is designed using MOC
![Thumbnail](/matlabcentral/mlc-downloads/downloads/74301faa-330f-4e37-87ea-8a2bf32bb148/5a5bfe73-b8a2-40ed-9e25-f64f822495ae/images/screenshot.png)
Ka.Race.Ing-Team at Karlsruhe Institute of Technology volunteered to share in depth and hands-on their approach around vehicle controls and torque vectoring in particular. They are winners of the Simulink Student Challenge 2016. And to top it all off, Julian our guest blogger today, added two of the...
![Thumbnail](https://blogs.mathworks.com/student-lounge/wp-content/blogs.dir/16/files/2017/11/thumbnail_title-1.png)
Solar Position Algorithm for Solar Radiation Applications
![Thumbnail](/matlabcentral/mlc-downloads/downloads/submissions/59903/versions/2/screenshot.gif)
MATLAB code for dimensionality reduction, fault detection, and fault diagnosis using KPCA.
![Thumbnail](/matlabcentral/mlc-downloads/downloads/830f7424-cfc6-4e11-a75a-5717d6aceb1a/e30800d6-fc99-43d3-a092-c0e027c9887c/images/1620937000.png)
© kreutzweise.de Great ideas don’t always stand the test of time. It may be due to some drawbacks that knock out the great advantage, or it simply is too expensive or difficult to implement. The following article will share a contradicting example. Enjoy this engineering success story of originalit...
![Thumbnail](https://blogs.mathworks.com/student-lounge/wp-content/blogs.dir/16/files/2018/02/Y0A7464-Edit-1-e1517563689357.jpg)
Open Source Simulation Package for MATLAB
![Thumbnail](/matlabcentral/mlc-downloads/downloads/9b77dac5-a36f-4fe7-b336-3026b3daf821/1bf32ecb-57f5-422b-87bc-ff2e76a50f5e/images/1625510508.png)
Model used in the "Understanding Kalman Filters, Part 7: How to Use Extended Kalman Filter in Simulink" video
![Thumbnail](/matlabcentral/images/default_screenshot.jpg)
Download code and watch video series to learn and implement deep learning techniques
![Thumbnail](/matlabcentral/mlc-downloads/downloads/submissions/62990/versions/3/screenshot.png)
Model used in the "Understanding Kalman Filter, Part 6: How to Use a Kalman Filter in Simulink" video
![Thumbnail](/matlabcentral/images/default_screenshot.jpg)
A toolbox for the computation of the Fast Marching algorithm in 2D and 3D.
![Thumbnail](/matlabcentral/mlc-downloads/downloads/submissions/6110/versions/3/screenshot.jpg)
abfload imports data in the Axon abf format (three different recording modes).
![Thumbnail](/matlabcentral/images/default_screenshot.jpg)
Adds new utilities to Fuzzy Control System Toolbox interesting for Fuzzy Control Systems.
![Thumbnail](/matlabcentral/images/default_screenshot.jpg)
Simulate articulated robotic arm
![Thumbnail](/matlabcentral/mlc-downloads/downloads/submissions/58255/versions/1/screenshot.png)
Today I’d like to introduce a guest blogger, Jiro Doke (email: Jiro.Doke@mathworks.com), who is an applications engineer here at The MathWorks. He used MATLAB in his life prior to The MathWorks, and one of his interests is data visualization. Contents Load Data Create Basic Plot Adjust Line Prope...
![Thumbnail](https://blogs.mathworks.com/images/loren/118/pubQualityGraphics_01.png)
it use Machine Learning in MATLAB to predict the buying-decision of Stock by using real life data.
![Thumbnail](/matlabcentral/mlc-downloads/downloads/90659e8b-6c27-4b84-889c-b1299afe3c67/0fc4e584-68a8-4a9b-a220-7f8e28db7b5e/images/screenshot.png)
Remove element(s) from cell array You can easily remove an element (or a column in any dimension) from a normal matrix, but assigning that value (or range) empty. For exampleA = 1:10A(5) = []results in1 2 3 4 6 7 8 9 10You task is to find the shortest, elegant, way in Matlab to do the same for cell ...
04 - Scalar Equations 1 Define the variable a:<<http://samle.dk/STTBDP/Assignment1_4-a.png>> Use this to calculate x:<<http://samle.dk/STTBDP/Assignment1_4a.png>> %%a=10;ref = 1/(1+exp(-(a-15)/6));user = MyFunc();assert(isequal(user,ref))%%[x a] = MyFunc();assert(a==10); func...
Length of the hypotenuse Given short sides of lengths a and b, calculate the length c of the hypotenuse of the right-angled triangle.<<https://i.imgur.com/73mQn4N.png>>Image courtesy of <http://upload.wikimedia.org/wikipedia/commons/7/7c/Right_Angle_Triangle.svg Wikipedia>. %%a = 1...
Simple and straight-forward implementation of DH-parameters in MATLAB.
![Thumbnail](/matlabcentral/mlc-downloads/downloads/submissions/56917/versions/8/screenshot.jpg)
PROGRAM FOR LOAD FLOW ANALYSIS USING THE NEWTON-RAPHSON METHOD
![Thumbnail](/matlabcentral/images/default_screenshot.jpg)
Free passes for everyone! _Simply return the name of the coolest numerical computation software ever_*Extra reward* (get a _freepass_):Once a month, as an additional reward for solving this problem, you may get a temporary freepass *to solve any other Cody problem*. To use this freepass follow these...
Password is : 123
![Thumbnail](/matlabcentral/mlc-downloads/downloads/submissions/61534/versions/1/screenshot.jpg)
Create an index-powered vector Given a input vector x, return y as index-powered vector as shown below.Example x = [2 3 6 9]then y should be [2^1 3^2 6^3 9^4] = [2 9 216 6561] %%x = [2 3 6 9];y_correct = [2 9 216 6561];assert(isequal(index_power(x),y_correct))%%x = [1 5 11 0 -3 -6];y_correct = [1 ...
This toolbox defines a new mp class allowing multiple precision objects in MATLAB.
![Thumbnail](/matlabcentral/images/default_screenshot.jpg)
A neuroestimator is used to enable speed-sensorless operation of the asynchronous motor drive.
![Thumbnail](/matlabcentral/mlc-downloads/downloads/submissions/48012/versions/3/screenshot.jpg)
03 - Matrix Variables 1 Make the following variable:<<http://samle.dk/STTBDP/Assignment1_3a.png>>A 9x9 matrix full of 2's(Hint: use *ones* or *zeros*) %%ref = ones(9,9)*2;user = MatrixFunc();assert(isequal(user,ref)) function aMat = MatrixFunc() *Insert code hereend Viable solution ...
Image display was added in version 4 of MATLAB, sometime around 1990. Many observant users noticed that the low-level image display object had default pixel values. In other words, if you called image with no input arguments, it would display a small image. If you were a MATLAB 4 user, you might h...
![Thumbnail](https://blogs.mathworks.com/images/steve/87/dp.png)
A demo showcasing the Koopman Operator in conjunction with Model Predictive Control (MPC) to control a nonlinear system.
![Thumbnail](/matlabcentral/mlc-downloads/downloads/a4a89843-def1-4782-b6d1-80c0bc024e97/abb9ef70-07b3-4a9e-8a30-b8e29c0f9f2b/images/1739326049.png)
I've been working to numerically integrate some singularity functions and I've encounted an inconsistency in matlab's symbolic integration that occurs when two singularity functions have the same threshold. To show the issue, I am integrating the following function in three different...
1
answer
I'm running calculations from a spreadsheet and I have some variables indexed. I want to subtract calculated variables from the indexed variables from my spreadsheet. I need to use values that are...
1
answer
I've been using c = subtract(shape1,shape2) but the resulting shape c does not appear to be fully defined. It only has vertices but the other important properties return []. This is an issue when c...
1
answer
I need to compute a matrix that is the product of some other matrices. What happens is that the entries of those intermediate matrices (not of the final one) have an extremely large number of...
1
answer
Workflow for generating a surrogate AI model from a multibody vehicle dynamics model.
![Thumbnail](/matlabcentral/mlc-downloads/downloads/c7a7d7d6-5eb2-4d37-b678-bb4eaf105a73/47d161e3-a0d4-4917-b588-fbe76913f209/images/1739290717.png)
Inputs of Cop and high pressure values to find optimal high pressure that maxes out COP
![Thumbnail](/matlabcentral/images/default_screenshot.jpg)
In today's blog, Khushin Lakhara from the Student Programs team at MathWorks will explore the concept of sensitivity analysis and its significance in engineering design. Over to you, Khushin... For this blog, our attention will be on the student competition score function, especially competiti...
![Thumbnail](https://blogs.mathworks.com/student-lounge/files/2025/02/Social-Media-Collateral-scaled.jpg)
Simulink has been an essential tool for modeling and simulating dynamic systems in MATLAB. With the continuous advancements in AI, automation, and real-time simulation, I’m curious about what the future holds for Simulink. What improvements or new features do you think Simulink will have in the c...
0
reply
Description:The Fibonacci sequence is defined as follows:F(1)=1,F(2)=1,F(n)=F(n−1)+F(n−2) for n2Write a function that computes the sum of all even Fibonacci numbers that do not exceed a given number NNN.Example:For N=10, the Fibonacci sequence up to 10 is:1,1,2,3,5,8The even numbers are 2 an...
I got thoroughly nerd-sniped by this xkcd, leading me to wonder if you can use MATLAB to figure out the dice roll for any given (rational) probability. Well, obviously you can. The question is how. Answer: lots of permutation calculations and convolutions. In the original xkcd, the situation desc...
1
reply
LUTool provides an interactive animation of Gaussian elimination, the most important algorithm in technical computing.
![Thumbnail](https://blogs.mathworks.com/cleve/files/LUTool_ico.png)
MATLAB FEX(MATLAB File Exchange) should support Markdown syntax for writing. In recent years, many open-source community documentation platforms, such as GitHub, have generally supported Markdown. MATLAB is also gradually improving its support for Markdown syntax. However, when directly uploading...
0
reply
I maintain some MATLAB web apps that are used internally by other MathWorkers. For one of the apps, I want to allow users to save default settings for the app's behavior. I think I will provide this...
![Thumbnail](https://blogs.mathworks.com/videos/files/thumb-play-arrow-11.jpg)
The following blog was written by Marshall Alphonso Principal Engineer and Sara Galante, Senior Finance Application Engineer at MathWorks Watch the full webinar Custom Portfolio Optimization: Balancing Objectives, Constraints, and Efficiency here, download the slides or download the code here. Por...
![Thumbnail](http://blogs.mathworks.com/finance/files/2025/02/custom-1024x662.png)
Marmosets, small primates native to South America, are known to be highly social primates. Living in family-based groups of up to 15 individuals, they use a complex system of vocalizations for communication. These sounds range from high-pitched calls to trills and whistles that are referred to as “p...
![Thumbnail](https://blogs.mathworks.com/headlines/files/2025/02/GettyImages-154534932-1024x680.jpg)
I noticed recently that my data is no longer updating on thingspeak again. Is there a connectivity issues with thingspeak Data not updating on thingspeak There are no connectivity issues. Take a look at some public channels that have been continuously updating for a while: ...
1
reply
my code is as below: #include "DHT.h" #define DHTPIN 15 // what pin we're connected to #define DHTTYPE DHT11 DHT dht(DHTPIN, DHTTYPE); #define THINGSPEAK_API_KEY "1P4RY69D3YMP9R5W" #include SoftwareSerial.h #include OneWire.h #include DallasTemperature....
2
replies
Find the value of x so that y=2 %%x = 1;y_correct = 2;assert(isequal(your_fcn_name(x),y_correct)) function y = your_fcn_name(x)x=y = x+1;end easy
This topic is for discussing highlights to the current R2025a Pre-release. R2025a Pre-release highlights One of the changes is the built-in support for Dark Mode and Themes. Personally I find Dark...
59
replies
Hi everyone The R2025a pre-release is now available to licensed users. I highly encourage you to download, give it a try and give us some feedback. The first thing I tried was switching to Dark mode. Here's the magic s = settings; s.matlab.appearance.MATLABTheme.PersonalValu...
6
replies
Since its April 2023 launch, the MATLAB extension for Visual Studio Code has been extremely popular with over 329,000 installs via the Visual Studio Marketplace at the time of writing. Our development approach to this extension has been to release early and often, responding to feedback from the com...
![Thumbnail](https://blogs.mathworks.com/matlab/wp-content/blogs.dir/26/files/2024/12/VSCodeDebug_4.gif)
This curriculum module contains interactive examples that teach fundamental concepts of power electronics.
![Thumbnail](/matlabcentral/mlc-downloads/downloads/1d0fee91-998e-4a26-b5b3-61beac23c691/c0b9bf90-87b0-45f0-9c71-4e635c076cd7/images/1729801879.png)
Try new Beta features to create, visualize, and run pipelines for machine learning workflows.
![Thumbnail](/matlabcentral/mlc-downloads/downloads/a7791dc8-a7fe-4eda-b23e-ab0e8a6a9338/88706cb1-25ac-4633-95c0-d1cb63d11291/images/1718917148.png)
Everyone's talking about Large Language Models (LLMs) and a huge number of you are using them too. Here are 4 ways to make use of them in the MathWorks ecosystem right now, no matter what your skill...
![Thumbnail](https://blogs.mathworks.com/matlab/wp-content/blogs.dir/26/files/2024/10/llm_2.png)
Back in April last year, I announced the MATLAB extension for Visual Studio Code on The MATLAB Blog and everyone at MathWorks was blown away by its popularity. In less than a year there have been...
![Thumbnail](https://blogs.mathworks.com/matlab/wp-content/blogs.dir/26/files/2024/03/VSCodeRun_4.gif)
This model demonstrates an ESS powered by solar which integrates renewable energy sources with an efficient battery storage mechanism
![Thumbnail](/matlabcentral/mlc-downloads/downloads/346a3ff7-1638-443c-bd5c-3c874b58a0be/cbb3f4e4-d6db-41d4-98b0-699ae8904643/images/thumbnail.png)
Representing the culmination of millions of person-hours of work conducted by thousands of engineers around the world, the latest release of MATLAB is always something of a celebration here at MathWorks. R2024b is no exception with thousands of new features, updates, improvements and bug fixes acros...
![Thumbnail](https://blogs.mathworks.com/matlab/wp-content/blogs.dir/26/files/2024/09/r2024bRelease_ver3_4.gif)
On 3 of my students' laptops that have Matlab installed, regardless of whether I use the publish function in the Command Window, or the publish tab at the top, I cannot get Matlab to generate a pdf. It gives me the same error on all 3 laptops: Error using mlreportgen.re.internal.xml.transfor...
5
answers
In the past two years, large language models have brought us significant changes, leading to the emergence of programming tools such as GitHub Copilot, Tabnine, Kite, CodeGPT, Replit, Cursor, and many others. Most of these tools support code writing by providing auto-completion, prompts, and sugg...
8
replies
Star Trek may have introduced the masses to the concept of a warp drive, but early references to this mode of travel date back to the 1930s in Jack Williamson’s science fiction novel, The Cometeers. Warp drives have been sprinkled throughout science fiction, but the “science” part has remained elusi...
![Thumbnail](https://blogs.mathworks.com/headlines/files/2024/09/GettyImages-1400105417-1024x576.jpg)
Vehicle templates with multibody suspension and electric powertrain sized for Formula Student competitions.
![Thumbnail](/matlabcentral/mlc-downloads/downloads/d27ece47-e708-4932-8c87-08a086485d4e/9fee1390-5ecf-4fbf-8277-0cb162901f31/images/1725635395.png)
Courseware teaching battery systems' basics, focusing on design and modeling with MATLAB, Simulink and Simscape.
![Thumbnail](/matlabcentral/mlc-downloads/downloads/c0809613-f0eb-4f36-8255-2809a3810bd1/8004b36d-9978-4d54-9794-d21511f95e5f/images/1726505905.png)
Given a continuousTimeStateSpaceModel comprising the matrices A, B, C, and D (albeit D = 0) and given a sample time Ts, how does discreteTimeStateSpaceModel = c2d(continuousTimeStateSpaceModel,Ts,method) comprising the matrices Ad, Bd, C, and D work for both 'zoh' and 'foh' as me...
2
answers
I am attempting to run MATLAB on my virtual machine. When I do so, however, MATLAB crashes with references to "vm3dgl64.dll" in the stack trace, such as the snippets below: [ 2] 0x00007ffd5899e3fe C:\Program Files\MATLAB\R2024a\bin\win64\libmwfl.dll+00058366 [ 5] 0x00007ffd3fd2c5bf C:\...
1
answer
Remove the row that contain the max value in the matrix?If you like the problem, please like it :) %%x = [1 2 3 4 5 6 ...
The idea is to swap between second and second last rowEx = [1 2 3 4 5; 5 4 3 2 1; 1 2 3 4 5; 1 2 3 4 5; ...
There is anyway for contacting support of of matlabwebsite? have any support team?
2
answers
I have three TEM images taken at different tilt angles, each showing grain boundaries. However, some grain boundaries are missing in each image. I need a MATLAB code to overlay or merge these three...
3
answers
Explore 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!
Connect with fellow users!
Use AI to generate initial draft MATLAB code, and answer questions!