Home - MATLAB Central

An open exchange for the MATLAB and Simulink user community


Cynthia Brewer's ColorBrewer palettes, ported to MATLAB, with nice interpolation.

Thumbnail

A minimum length 2D planar bell nozzle is designed using MOC

Thumbnail

In this post, I will discuss robot modeling and simulation with Simulink®, Simscape™, and Simscape Multibody™. To put things in context, I will walk you through a walking robot example (get it?).

Thumbnail

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

Solar Position Algorithm for Solar Radiation Applications

Thumbnail

MATLAB code for dimensionality reduction, fault detection, and fault diagnosis using KPCA.

Thumbnail

© 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

Open Source Simulation Package for MATLAB

Thumbnail

Model used in the "Understanding Kalman Filters, Part 7: How to Use Extended Kalman Filter in Simulink" video

Thumbnail

Download code and watch video series to learn and implement deep learning techniques

Thumbnail

Model used in the "Understanding Kalman Filter, Part 6: How to Use a Kalman Filter in Simulink" video

Thumbnail

A toolbox for the computation of the Fast Marching algorithm in 2D and 3D.

Thumbnail

abfload imports data in the Axon abf format (three different recording modes).

Thumbnail

Adds new utilities to Fuzzy Control System Toolbox interesting for Fuzzy Control Systems.

Thumbnail

Simulate articulated robotic arm

Thumbnail

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

it use Machine Learning in MATLAB to predict the buying-decision of Stock by using real life data.

Thumbnail

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 ...

Roll the Dice! DescriptionReturn two random integers between 1 and 6, inclusive, to simulate rolling 2 dice.Example [x1,x2] = rollDice(); x1 = 5; x2 = 2; %%filetext = fileread('rollDice.m');illegal = contains(filetext, 'assignin') || contains(filetext, 'regexp');assert(...

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

Solving Karnaugh Map problems.

Thumbnail

PROGRAM FOR LOAD FLOW ANALYSIS USING THE NEWTON-RAPHSON METHOD

Thumbnail

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...

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

A neuroestimator is used to enable speed-sensorless operation of the asynchronous motor drive.

Thumbnail

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...

Categories:
Thumbnail

When I installed the matlab 2024b i tried to sign in from my university however the pop out window shows error instead of opening the dailog box for email. I tried uninstalling and reinstalling stil the issue is same. I have attached the screenshot for your kind refrence.

0

answer

Hi there, as the title says, I want to know if Simscape Multibody can calculate the natural frequencies of the Stewart Platform? In this platform, the six intermediate links are flexible, and the base and the end effector are rigid. Many Thanks!

0

answer

Hi there, Here I have the following recursive code fMin1D to find the local minima of a user-defined function f=fun(x). fun(x) is able to evaluate a sample array x =[x1 … xn] and return values f =[f1 … fn] . function x0=fMin1D(x1,xN,N,eps,x0,fun) % samples to be scanned Neps=1+ceil((log(xN)-log(...

2

answers

Hello everyone! I have data of a cylinder with certain tempretures at each point and the data is unfortunatley in X,Y,Z coordinates (as if the cylinder is floating in a cartesian system). I wrote...

0

answer

whenever i open simulink it is showing an error of lincense checkout failed while is frustrating and the day before only i spend too much time on my system downloading the latest model which was...

1

answer

A demo showcasing the Koopman Operator in conjunction with Model Predictive Control (MPC) to control a nonlinear system.

Thumbnail

Workflow for generating a surrogate AI model from a multibody vehicle dynamics model.

Thumbnail

Correlation from the paper "An Improved Correlation for Turbine Endwall Loss", Coull 2025

Thumbnail

Inputs of Cop and high pressure values to find optimal high pressure that maxes out COP

Thumbnail

Ss

Thumbnail

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...

Categories:
Thumbnail

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

Shor's algorithm, proposed in 1994 by Peter Shor, is an algorithm for factoring numbers that runs in polynomial time (polynomial in the number of digits/bits of the input) on a quantum computer. It...

LUTool provides an interactive animation of Gaussian elimination, the most important algorithm in technical computing.

Thumbnail

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

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

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...

Categories:
Thumbnail

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

Tags:

A sequence is constructed in the following way. The zeroth term is 1, and the next terms are determined by counting the number in the sequence so far. Therefore, after the first count, the sequence...

The numbers 13, 14, and 15 are consecutive, of course, but they also share the property of being square-free. That is, each number has no prime factors that are repeated. Another group of three...

Be Part of MATLAB Central

Community Video
MATLAB Answers

Ask & Answer questions about MATLAB & Simulink!

File Exchange

Download or contribute user-submitted code!

Cody

Solve problem groups, learn MATLAB & earn badges!

Blogs

Get the inside view on MATLAB and Simulink!

Discussions

Connect with fellow users!

AI Chat Playground

Use AI to generate initial draft MATLAB code, and answer questions!

Go to top of page