Answered
For uicontrol, why can't "UserData" property hold a structure but 'UserData' can?
One of the many places where using strings instead of char arrays will trip you up. I haven't searched for one, but I've never y...

8 years ago | 0

| accepted

Answered
How to Define Title Before Plotting?
Because |plot| is a high level command and will clear a lot of things, unlike the |line| function (which is what |plot| is calli...

8 years ago | 2

| accepted

Answered
A car laps a racetrack in 90s. The speed of the car at each 6 second interval is determined using a radar gun and is given from the beginning of the lap, in m/s.
Two changes (also, |k| is unused): function Q2(~) k=[0,1,2,3,4,5,6,7,8,9,10,11,12]; t=[0,6,12,18,24,30,36,42,48,54,60...

8 years ago | 0

| accepted

Answered
How to create an array with its cells are vector variable?
You should use curly braces to make cells: A={a b c};

8 years ago | 2

Answered
I have this problem
The easiest way to do this is with a loop. A second method is less easy to follow, but removes the need for a loop. The final st...

8 years ago | 1

| accepted

Answered
How can i do the scaling with negative integer.. i have done this with the positive integer?
To have negative steps with the <https://www.mathworks.com/help/matlab/ref/colon.html colon operator>, you need to make sure you...

8 years ago | 0

| accepted

Answered
How do I make the loop run?
The |dir| function returns a struct array, so you can loop through those: file_list=dir('tdump*');%replace this by your own...

8 years ago | 0

Answered
How can I Read all the details of my .txt file
If you use <https://www.mathworks.com/help/matlab/ref/dlmread.html |dlmread|>, you can define a number of rows you would like to...

8 years ago | 0

| accepted

Answered
How to fix this erro in GUIDE?
Either end all functions with the |end| keyword, or end none of them with the |end| keyword. The default that GUIDE uses is not ...

8 years ago | 0

Answered
Can I install Matlab 2013a on Windows 10 64 bits machine?
Although Windows 10 is not in the <https://www.mathworks.com/content/dam/mathworks/mathworks-dot-com/support/sysreq/files/System...

8 years ago | 0

| accepted

Answered
How to extract complex cell data into a new variable?
Using a double loop to accomplish this is still reasonably fast: %generate a random H s1=2000;s2=13; H=cell(s1,1); ...

8 years ago | 0

| accepted

Answered
Store every n rows of a matrix in cell
You can do that with the |mat2cell| function. A=rand(11808,1); k=96; B=mat2cell(A,k*ones(size(A,1)/k,1),1); Note t...

8 years ago | 2

| accepted

Answered
How do i find the coordinates of point given its intensity ??
The second output of |max| returns a linear index, which you can convert to subscripts with |ind2sub|. [maxval,maxind]=max(...

8 years ago | 0

| accepted

Answered
Using a matrix to define which rows to display from another
med=(-0.5:1.5)+size(M,1)/2;

8 years ago | 0

Answered
Fopen: Invalid Parameter List
There may be more errors (please include your file so we can check), but at the very least you should use |fopen| with the read ...

8 years ago | 0

Answered
How to read text file line by line and store line into cell array?
You need to generate a valid fileID with |fopen|. Then you can use other file reading tools, which you shouldn't mix like this. ...

8 years ago | 0

| accepted

Answered
Creating dummy variables with if statements
You should try the crash course that Mathworks provides for free <https://matlabacademy.mathworks.com/R2018a/portal.html?course=...

8 years ago | 2

Answered
How to other all the matrix based on other vector
Matlab is not zero-indexed, hence the +1 below. B = [0 0 ; 1 4 ; 2 16 ; 3 19 ; 4 5 ; 5 39 ; 6 4] ; C = [3 4 5 6 0 1]; or...

8 years ago | 1

| accepted

Answered
How to properly apply cellfun in this case - text spliting
You need to have the index available as a separate input: A = cellfun(@(x,ind) x(1:ind-1),t{:,1},num2cell(Blank1st),'Unifor...

8 years ago | 1

Answered
Plotting the difference of two functions and finding the roots - octave
You can just define a new anonymous function and use that as an input to fzero, just like you would in Matlab. <https://octave.s...

8 years ago | 0

Answered
Help with MATLAB Code - Plot is ignoring 0 value
Actually the zero value *is* undefined, because of a division by zero. You can use |isnan| to replace this with 0.

8 years ago | 0

| accepted

Answered
How to save these for loop's outputs in 4x3 matrix format?
You mean like this? X = [4 1 9 ;1 9 9]; Y = [0 1 5 ;0 9 6]; Z = [Y X]; output=cell(3,6); for f=1:3 for g...

8 years ago | 0

Answered
Looping through folders and perform script
# Use a |dir| call to figure out the number of suffixes (or suffices?) # Use two nested loops to determine the selection of you...

8 years ago | 0

| accepted

Answered
Hello! I would like to know how can i disable the button maximize from figure window
You could make the position relative (i.e. change the |Units| to |Normalized|), or simply set the figure property |Resize| to |o...

8 years ago | 1

| accepted

Answered
hi how can I graph a multisphere
According to the <https://www.mathworks.com/help/releases/R2018a/pde/ug/multisphere.html doc> it was introduced in R2017a, altho...

8 years ago | 0

Answered
How do I avoid this error "Subscript indices must either be real positive integers or logicals?"
You should use functions to represent functions. Although you can follow Geoffs advice to fix this particular issue, your could ...

8 years ago | 0

Answered
Is it possible to use regexprep to insert a '*' between a number following a letter?
Now I'm awake again: you can also do this in a oneliner: str='C2+H4-28D'; m=regexprep(str,'([A-Za-z])(\d)','$1*$2');

8 years ago | 4

| accepted

Answered
Matrix dimensions and unbalanced bracket problem
Here's a complete plot. You also forgot to put in extra exponents for the lower bounds. %t=0:1e-6:10e-6; t=linspace(0,10...

8 years ago | 0

| accepted

Answered
how can i read from matlab ".txt" file
This is working code that should be able to do what you want: function [header,ppv,pl,ps_d,ps_c,pg_i,pg_s,ppv_s,pl_s,soc_op...

8 years ago | 1

Answered
How to filter a binary matrix through a binary vector?
Here are two ways to do this: E = [0 1 1 0 0]; S = [1 1 0 1 0; 1 1 1 1 1; 1 0 0 1 1]; S_E=S(:,logical(E)); E = [...

8 years ago | 0

| accepted

Load more