An open exchange for the MATLAB and Simulink user community
Why do I get the 'We have detected suspicious behavior' prompt? kA03q0000015O7gCAE 000184625
1
answer
This example project can be used as a reference design to get started with designing Battery Management System with MATLAB and Simulink.
An algorithm for manifold learning and dimension reduction.

I'm trying to write an equation with e, but I assume it would just take it as an undeclared variable.
3
answers
Online optimization of energy storage actions in a microgrid given system constraints and pricing

PID controller simulator on an LTI system w/ or w/o input delays
MATLAB/Simulink Based Modelling of Solar Photovoltaic Cell, Panel and Array

MATLAB-Simulink model of IEEE 33 Bus System (Baran and Wu, 1989)

Learn how to deploy an algorithm to an FPGA using MATLAB and Simulink.

BESS are commonly used for load leveling, peak shaving, load shifting applications and etc.

Rad/s is nice for mechanical people, but I'm an EE, and I much prefer Hertz. It should be something simple, but I can't find it in the help.
4
answers
Simscape electrolyzer converting water and electricity (wind/solar renewable sources) into H2 gas. Alkaline technology included.

Hello, i am trying to make a bode plot of the transfer function of a twin-t notch filter, that i am analyzing. I was able to produce the transfer function, and the bode plot by hand, but i am struggling to do it in Matlab, here is what i have so far: r=320; %Resistance c=100*10^-9; %Capactiance p=(...
1
answer
Example files for MATLAB and Simulink Robotics Arena walking robot videos.
Virtual labs and mechanisms for studying controls.

I'm using Dell precision 7510 with preinstalled Ubuntu 14.04(I have the driver the NVIDIA). I just downloaded the MATLAB R2017a and I run into the following error. I just searched and found it's not just me who have the same problem. I wonder if this problem is fixable? To put it in another...
9
answers
I am trying to find zero-crossings of a function in Matlab and plot the points where zero-crossing occurs. However, i am not able to find an easy way. I tried and Matlab fnzeros, but i can't understand the spmak and x,y used in these function. The function for which i want to find zero crossing...
8
answers
In this model, a Microgrid test system based on the 14-busbar IEEE distribution system is proposed.

When I plot the frequency domain the power is not 3 and 5 as I expect. I read the documentation for fft() and cannot figure out how to normalize my fft properly. Can someone explain the procedure to normalize the cosines and a Gaussian wave? Thanks clear all; %generate the signal t = 0:1/2000:.02; ...
1
answer
I want to ask the user if they want to EXP1 or EXP2. If the user enters '1' or '2', then I want to display "running exp 1 or 2", otherwise I want the program to display error message until the user enters '1' or '2'. prompt = input('Please enter 1 for E...
4
answers
I have a histogram that I want to plot just as a simple line plot. I have tried: h = histogram(speed,'Normalization','probability') plot(h) But then I got an error message: Not enough input arguments. Does anyone know how I can do it? Many thanks!
4
answers
Hi, Community I wanna ask about how to do a Gaussian Filter in just 1D data.... So i have a data vector based on time series like this : And i want to filter the data by using Gaussian Filter. So, Anyone, How to do that? Thank you so much....
1
answer
Hello i have a 54000 x 10 matrix i want to split it 70% training and 30% testing whats the easiest way to do that ?
5
answers
A minimum length 2D planar bell nozzle is designed using MOC

I am a python programmer and new to Matlab. Therefore, facing some basic issues. Please help me out with this. I am pasting my code here. Error Message: Index in position 1 is invalid. Array indices must be positive integers or logical values. Error in spectrum_uncompressed (line 30) X_per_bartlett...
2
answers
How can I plot this state space like the graph I attached by using tf() and step() command? Thank you! I2/E0=1/(s^3+s^2+3*s+1)
2
answers
The modal parameters of a line-like structure are automatically identified using an SSI-COV algorithm applied to ambient vibration data

Fast 2D phase unwrapping implementation in MATLAB

I need to convert my matrix [648x2400 double] into integers value to use a mRMR function, but I do not know how to do that. I have tried to convert by uint8(matrix) or int8(matrix) but it does not give integers... And I always have this note: "Undefined function 'mrmr_mid_d' for input ...
4
answers
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...

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

this is the QAM modulation and demodulation tech. with speech example
abfload imports data in the Axon abf format (three different recording modes).

Hi I've a question about matlab simulink when I run a code, there are message "MATLAB cannot run this file because c:\~~~ shadows it. delete shadowing file and try again" what's the problem? And why this happen??
4
answers
How can I download 2011b version of MATLAB?
5
answers
This keeps coming up as an error, what am I doing wrong? prompt= 'State your name, Your Grace '; name=input(prompt);
2
answers
I'm new to MATLAB and am still getting used to the workspace. When I open a new file or script, it always comes out in a new window. How can I get it to be opened in the same window as the commands? Thanks!
2
answers
Let's say I am working in the directory: /home/username/Matlab/ I want to save (in a script) the directory one above the one I am working in (to use it later in the script), so: newdir='home/username'; But I am working in different computers, so the 'username' changes, thus I wa...
4
answers
Hello , I want to concatenate string and number in for loop requestID = Req_Check; for k = 1 : 10 requestID = requestID +1; end I am expecting requestID after for loop like Req_Check_1, Req_Check_2 ...Req_Check_10 How can I do this?
3
answers
I closed the "Current Folder" window by mistake. How can I re-display it?
4
answers
I have two categorical column vectors of size 872-by-1. I want to calculate the Levenshtein distance between these two. When I am using the command 'editDistance' for this I am getting an error as "Argument 1 must be a string array, a character vector, or a cell array of character vect...
1
answer
y25=[1.875000000000000,3.046875000026040] How can I add 0 (zero) to the beginning of this array? I want to get the array y25=[0,1.875000000000000,3.046875000026040] Thank You.
1
answer
My code so far is below. I have the code so that it skips the first 19 lines and starts at line 20. However, I need to remove the NaN values that are in my data like Columns = [10;0.04500;0;NaN;NaN] for example. The line I have to remove the NaN's runs, it's just not removing them. I'm ...
4
answers
HVDC system with three level neutral-point clamped VSC

Generate an image pyramid or reconstruct from a pyramid.

Wilkinson's polynomials are a family of polynmials with deceptively sensitive roots.

I am trying to export my CAD model from Solidworks via Simscape Multibody link, only it gives me error: Unknown constraint. I have created a link called slot mate and I don't understand why it...
0
answer
hen using the 2024b version of Thermal Liquid Settings (TL), I imported the property equations for NaK78 (a liquid metal), including the specific heat at constant pressure cp(T)=938.6-2.1924*(T-273.15).*10^(-1)+2.1091*10^(-4).*(T-273.15).^2+56.36*(1-0.0040549*(T-273.15)).*exp(-0.0040549*(T-273.1...
0
answer
I have a MATLAB project, which I compile using the MATLAB compiler to a JAR file and call from a Java project. I have been using the compiled file on Windows without any issues for a few years....
0
answer
Hi, Seems the SOS block works fine if coefficients are entered as "dialog parameters", but using input ports is not working for me. This is the process: Bcoeffs = px3 array save('Bcoeffs_file.mat','Bcoeffs','-v7.3'); Then I connect the mat file in simulink to th...
0
answer
Hi, Is there any way I can remove the out of focus part from the given image in matlab?. I have attached the sample image here. Kindly help.
0
answer
Learn the basic of quantum computing, how to simulate quantum circuits on MATLAB and how to run them on real quantum computers using Amazon Braket. There will also be a demonstration of machine learning using quantum computers! Details at MATLAB-AMAZON Braket Hands-on Quantum Machine Learning Wor...
0
reply
Illustrates resampling an empirical distribution to estimate model-free values and confidence intervals for various statistics.

Code to reproduce the figures of paper "Choice of trimming proportion and number of clusters in robust clustering based on trimming"

Load AWS Credentials for Accessing EOSDIS Datasets on S3 with MATLAB

MATLAB makes it easy to integrate Python®-based AI models into your MATLAB and Simulink workflows. You can call PyTorch® and TensorFlow™ models - or any Python code - directly from MATLAB. For example, you can compare Python-based models to evaluate their accuracy and performance as part of the AI ...

Do you conduct research on 'Engineered Systems'?If you are in the business of building or conducting research on 'Engineered Systems' there's a good chance that you are a user of MathWorks' tools. At MathWorks we talk about 'Engineered Systems' all the time but I don&...

We recently hosted a technical webinar focused on climate transition risk, specifically assessing climate impacts on credit risk. Elre Oldewage and Sara Galante, both application engineers at MathWorks presented the work our team has been doing in this space and how we can assist our customers who a...

Guest Writer: Eric Ludlam Joining us again is Eric Ludlam, development manager of the MATLAB charting team. Discover more about Eric on our contributors page. MATLAB Graphics supports 3D shapes and lighting properties, but the light objects don't cast shadows. Let's explore a way to...

Good day I am looking someone to help me on the matlab and simulink I am missing some explanations.For easy communication you can contact 0026876637042 I am in need of help
0
reply
Recently my iMac became sluggish. I checked Activity Monitor and found it was spending most of its time in mds_stores. I turned of Apple Intelligence under System Settings - Apple Intelligence &...
1
reply
The GCD approach to identify rough numbers is a terribly useful one, well worth remembering. But at some point, I expect someone to notice that all work done with these massively large symbolic...
0
reply
Yes, some readers might now argue that I used roughness in a crazy way in my last post, in my approach to finding a large twin prime pair. That is, I deliberately constructed a family of integers...
0
reply
Econometric modeling is essential for analyzing economic data, making forecasts, and informing policy decisions, however, traditional approaches often require extensive coding expertise, making them inaccessible to many economists and analysts. With the Econometric Modeler app in MATLAB, you can bui...

In this problem, you are tasked with rotating a given matrix by 90 degrees in a counter-clockwise direction. The input will be a square matrix (i.e., the number of rows is equal to the number of...
You recently bought an electric kettle for your kitchen, and you want to estimate how much it costs to run every month. The kettle operates at 230V and consumes 2000W (or 2kW) when in use. You...
A voltage divider is a simple circuit used to obtain a reduced voltage from a higher voltage source using two resistors in series. The output voltage (Vout) is given by the formula:Where:Vout is...
In an electrical circuit, the current (III) flowing through an LED is determined using Ohm’s Law:Where:I is the current in amperes (A)V is the supply voltage in volts (V)Vf is the forward voltage...
The energy (EEE) stored in an inductor is given by the formula:Where:E is the energy in joules (J)L is the inductance in henrys (H)I is the current in amperes (A)Write a function that takes...
Almost immediately after the DeepSeek-R1 AI models were made available to the world, people started asking how you can use them in MATLAB. Late last week, Vasileios Papanastasiou, a software test engineer at MathWorks, posted how to do this on LinkedIn and this morning I tried out his instructions f...

Try new Beta features to create, visualize, and run pipelines for machine learning workflows.

In this blog post we are going to show you how to use the newest MATLAB functions to: Import models from TensorFlow and PyTorch into MATLAB Export models from MATLAB to TensorFlow and PyTorch This...

This curriculum module contains interactive examples that teach fundamental concepts of power electronics.

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

This model demonstrates an ESS powered by solar which integrates renewable energy sources with an efficient battery storage mechanism

Deep neural networks like convolutional neural networks (CNNs) and long-short term memory (LSTM) networks can be applied for image- and sequence-based deep learning tasks. Graph neural networks (GNNs) extend deep learning to graphs, that is structures that encode entities (nodes) and their relation...

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...
65
replies
This week I received a series of interesting questions on the basics of putting together a simulation of a control loop involving a Simscape continuous plant and a discrete controller. The questions are summarized in this image:Here are my answers to those questions.Discrete ControllerI recommend im...

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...
9
replies
You've probably heard about the DeepSeek AI models by now. Did you know you can run them on your own machine (assuming its powerful enough) and interact with them on MATLAB? In my latest blog post, I...
2
replies
Starfish Optimization Algorithm (SFOA) is a novel bio-inspired metaheuristic for solving optimization problems.

On 27th February María Elena Gavilán Alfonso and I will be giving an online seminar that has been a while in the making. We'll be covering MATLAB with Jupyter, Visual Studio Code, Python, Git and...
1
reply
Hello everyone, I’m planning a new PC build and am currently undecided about which CPU to choose. I understand that AMD CPUs have faced some slower performance in MATLAB due to Intel MKL but I...
4
answers
Pretrained YOLO v8 networks for object detection and segmentation in MATLAB, with support for importing Python YOLO v8 models.

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 ...
Why does MATLAB crash sporadically on my 13th or 14th generation Intel CPU but not on other machines? The crash log is different each time, and the code works fine on other computers. kA0UU0000006psf0AA 000606821
1
answer
Delete rows with specific properites as following:Find rows that have a negative value in any element of the row and delete it.Check if the last element of the row is equal of bigger than 24 and...
Hi, I'm solving a system of equations . x=null(A); The problem is that due to a very wide range of values in the A matrix () the roundoff error result in inacceptably large relative errors in the...
2
answers
Hey everyone! I recently came across a bug on ArchLinux when using MATLAB. Since some time (about last week or 2 weeks ago), everytime I try and startup MATLAB (either from cmd, or application shortcut) I get the following error: Command `service` threw an exception Error loading /home/timey/.Ma...
3
answers
I 'm using contour option in Matlab R2014a to plot many curves: contour(x,y,c,cilevels); with cilevels = [0.0,.005,0.019]; but I need to select one curve (level) from the contour: the option peaks is not working? and I have tried : contour(x,y,c,[1 1]); but it was error also? could you pleas...
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!