Answered
Why do I keep getting "Array indices must be positive integers logical value"
In general that error comes from trying to index an array with something other than a positive integer or a logical variable. So...

5 years ago | 0

Answered
Phase Shift Sawtooth Wave
if you just want to shift it so that it starts at (0,0): tri = T_amp*sawtooth(T_freq*ft, .5) + T_amp; Note that with the above...

5 years ago | 1

Answered
How to determine median pixel intensity for each pixel from x number of pictures
Suppose your images are each in a mRow by nCol array and you have numImages total number of images. If you put all of the images...

5 years ago | 0

| accepted

Answered
how to plot magnitude and phase spectrum? my output function is
If you have the control system toolbox you could do something like: % define a discrete time system z^-5+z^-4+z^-3+z^..1 with a...

5 years ago | 0

Answered
How can you find the poles of a steady state system using c2d and the sampling frequency ?
Suppose you have a continuous plant model g and you discretize it with the sampling period ts % discretize gd = c2d(g,ts) %...

5 years ago | 0

Answered
Loops vs. Vectorization
It may be useful for you to know that for example M = [3 5 7] == [2; 3; 4;] % row vector == column vector gives a matrix 3×3...

5 years ago | 2

| accepted

Answered
Plot Root Locus for PD-Controller
I don't think you can do it directly with the rlocus command which is just for a variable overall open loop gain. One way to do...

5 years ago | 0

Answered
How can I implement lsqcurvefit function on my equations?
From your description, it sound like you want to find the solution to a system of 5 equations (in I assume 5 unknowns). In this ...

5 years ago | 0

| accepted

Answered
finding the mean based on a specific value in other column
Lets say you have put your data into an array X. Find a logical index where the rows match your criteria using: criteria = [52...

5 years ago | 0

Question


How to programmatically change tunable masked parameters while a simulation is running?
I would like to programmatically change masked parameters while a simulation is running. I have made the parameters "tunable" ...

5 years ago | 1 answer | 0

1

answer

Answered
Getting directly range of value from MATLAB table?
I'm not sure what you mean by not using indexing. In case this helps here is one way to do it. Suppose you have a table T, with ...

5 years ago | 0

Answered
How do you find the best path in a grid or matrix of dimensions MxN?
You should be able to write a recursive function to do this. The function would provide the next row and column to move to give...

5 years ago | 1

Answered
How do I assign a number to an image in a cell array?
If you have a number of characteristics and don't want to have some elaborate encoding for how these are all specified I would p...

5 years ago | 0

Answered
Error "Function definitions are not permitted in this context" in matlab R2014a
You can not define functions on the command line. Open up a new file and edit it there On the MATLAB menu bar HOME>New>Function...

5 years ago | 0

| accepted

Answered
Plotting outputs at certain simulation time
The exact details depend upon what format you are using to save your Simulink output. It can be saved as a Simulink dataset, an ...

5 years ago | 0

| accepted

Answered
Graph behaviours in Simulink
I don't think you should be using the derivative block. I don't see that in the original diagram. Also it makes no sense to diff...

5 years ago | 0

Answered
How do you pull select columns from dozens of .csv files in a directory and make one long vector with all the values?
% I'll assume that your files are named follwing some meaningful pattern, e.g. data01.csv, data02.csv, ...You can adapt using yo...

5 years ago | 0

Answered
How to draw a histogram of my data?
I'm not really sure what you are trying to make a histogram of. It looks like you just want to know how many equally spaced valu...

5 years ago | 0

| accepted

Answered
How to plot 3D surface from 2D array?
There is also a MATLAB function called streamtube https://www.mathworks.com/help/matlab/ref/streamtube.html which seems closely ...

5 years ago | 0

Answered
how i can import specific rows from excel and than use that row in equations MATLAB .
You can use the matlab command readmatrix to get the data in from Excel (type doc readmatrix on the command line for details) T...

5 years ago | 0

Answered
discontinuous x axis plot
I don't think there is a MATLAB command for this but there are many file exchange submissions that should help you https://www....

5 years ago | 0

Answered
Solving simultatious equations with inequalities
If you have the optimization toolbox you can use fmincon for this. Please type doc fmincon on the command line for further detai...

5 years ago | 0

| accepted

Answered
Add data to .csv file using matlab
In MATLAB put the data into a table array. Then use writetable with the 'WriteMode','Append' property value pair. Please see htt...

5 years ago | 0

Answered
How to sort based on two columns
You should be able to use sortrows for this. Please type doc sortrows on the command line for further documentation

5 years ago | 0

Answered
While loop not working in MATLAB app designer callback function
You probably have a scoping issue. Shared values are typically stored variable names such as app.myVariable To give any more sp...

5 years ago | 0

Answered
Create a series of vector with different name
I would suggest rather than naming your subvectors, you reorganize your data to put it into a matrix where each column is one of...

5 years ago | 0

Answered
Deconvolution of a polynomial and exponential function
Your overview of what you are trying to do is helpful, but I think a lot more details are needed to help with the MATLAB impleme...

5 years ago | 0

Answered
While loop word problem
You will need to add the details but you probably want to do something like this % set some parameters runHours = 12; % number...

5 years ago | 0

| accepted

Answered
What else can I do to speed up evaluation of this function?
You can get determine where you are spending time using MATLAB's profiler https://www.mathworks.com/help/matlab/matlab_prog/prof...

5 years ago | 1

| accepted

Answered
How do i make a uipanel with checkboxes return information to my script?
I have attached a modified script to generate your ui, which I have called checkboxGo. Note that in this I have used a simple l...

5 years ago | 0

| accepted

Load more