Réponse apportée
How can i find an eleiment which comes only one in a matrix ?????
When A only contains positive integers: A = [1 2 3 1 2 4 1 2 4 5] B = find(sparse(A(:),1,1)==1)

presque 10 ans il y a | 0

Réponse apportée
How do I replace multiple values with one value in a cell array
Do you need it to be a cell array? It would be easier if you converted it to a numerical array. You can use *HISTC* to assign bi...

presque 10 ans il y a | 0

Réponse apportée
subplot in loop and save final figure, when clear all used after each loop
Generally the use of _clear all_ is not to be recommended, except at the beginning of a script. You can use *CLEARVARS* to free ...

presque 10 ans il y a | 0

Réponse apportée
Hi, I would like to save a vector (size change at every loop) in a matrix
Vectors with different sizes cannot be stacked into a single array. You can, for instance, use cell arrays as an alternative. ...

presque 10 ans il y a | 0

Réponse apportée
How to select specific data from a structure
Store your data like this data.variation(1).values = .. data.variation(2).values = .. data.variation(3).values = .. ...

presque 10 ans il y a | 2

Réponse apportée
Plots: Not traceable Line Plot
Do the order of the data points in the vectors make sense? I assume the vector data.DataTime is *not* monotonically increasing (...

presque 10 ans il y a | 0

Réponse apportée
How to fit a function with mutiple variables
So you're fitting a surface in 3D space, z = f(x,y) Take a look here: http://uk.mathworks.com/help/curvefit/fit.html

presque 10 ans il y a | 0

Réponse apportée
Please help me in generating multiple matrices and calculation
Add an extra loop to create a 3D matrix: N = 5; % No. of matrices P = 5; % The number of rows T = 10; % The number ...

presque 10 ans il y a | 0

Réponse apportée
How do I make a new variable made up of specific row from other variables?
Repeat ten times after me: *It is the contents of a variable that should be flexible, not the name!* (Print this and tape thi...

presque 10 ans il y a | 2

Réponse apportée
How to assign a structure with fields (incl the values in the fields) as an output in function?
function Sout = myfunction(x) S(1).field(1) = x ; S(2).field(2) = 2*x ; % etc. Sout = S ; % just copy %...

presque 10 ans il y a | 0

| A accepté

Réponse apportée
can anyone help in getting a matrix of 0's and 1's in which each row contains only one 1 and that 1 is restricted to take some places in each row?
r = [3 4 2 1 3] ; % last r(k) values of row k should be 0 N = 10 ; % number of columns A = zeros(numel(r), N) A(sub2i...

presque 10 ans il y a | 0

Réponse apportée
Plotting cos(omega*t)?
This might guide you a little: t = linspace(0,10,1000) ; % time vector f = 20 ; % a frequency omega = 2.*pi.*f ; % c...

presque 10 ans il y a | 1

| A accepté

A soumis


randone1
random array with one 1 per row (and column)

presque 10 ans il y a | 1 téléchargement |

0.0 / 5

Réponse apportée
Can anyone help me to generate a matrix of 0's and 1's randomly in which each contains only one 1 like [ 0 1 0 0 0; 1 0 0 0 0; 0 0 0 1 0].
One 1 in each ... what? rows, columns, or both? Given your examples and comment I assume both, so here is a simple one-liner....

presque 10 ans il y a | 0

Réponse apportée
Can i set all text boxes to their default value by using only one command
This task would be utterly trivial if you had put the handles to the boxes into an array on creation! handles.text(1) = .. ...

presque 10 ans il y a | 1

Réponse apportée
Random "Function definitions are not permitted in this context." When running integral
It does not happen to me. Did you perhaps overwrite the integralCalc.m file? It should start with the word function.

presque 10 ans il y a | 0

Réponse apportée
Combine numerous arrays with similar names
You should be able to avoid this problem by loading them into array of structs or cells, rather than in variables with variable ...

presque 10 ans il y a | 1

Réponse apportée
error with max function
What does which max tell you? Probably you have overwritten the function.

presque 10 ans il y a | 2

| A accepté

Réponse apportée
I need to plot a line of best fit to an equation which includes constants
xmin = min(x) x2 = cos(2*(xmin-x)) p = polyfit(y,x2,1) A = p(2) B = p(1)

presque 10 ans il y a | 0

Réponse apportée
How to use fprintf in Matlab R2016a
The problem is with fopen. Did you check the value of fileID? Most likely, you do not have the permission to write in the cur...

presque 10 ans il y a | 2

Réponse apportée
Problem with convert acceleration to velocity and displacement
Apparently there is an offset in your acceleration data. You can subtract a running mean A(k) = ValueFromDaq - mean(A(1:k-1)...

presque 10 ans il y a | 0

Réponse apportée
remove null terms from a string and adjust signs
str1 = strrep(str,'(0)*','') str2 = strrep(str1,'*(0)','')

presque 10 ans il y a | 0

Réponse apportée
How to delete rows from a CELL with certain values?
Similar question, similar answer ... <http://uk.mathworks.com/matlabcentral/answers/288229-how-to-remove-the-rows-with-partic...

presque 10 ans il y a | 0

| A accepté

Réponse apportée
I have three data sets. positions(p), depth(d) and conecentration(c). So I want single plot of concentration(y axis) against depth (yaxis) and position (x axis). It should be a single plot of c following p and d.I used plotyy/addaxis but I get 2 plot
Your questions suggests that two variables should be on the same y-axis. This is logically impossible ... Here are some comma...

presque 10 ans il y a | 0

Réponse apportée
Assign matrix names using for loops in formula
Remember: *It is the contents of the variable that should be flexible, not its name!* You will be way better off using arrays...

presque 10 ans il y a | 1

| A accepté

Réponse apportée
Datenum comparison not behaving
MM refers to minutes rather than months ... Use the lower case format string! datenum('20160113','yyyymmdd') See the hel...

presque 10 ans il y a | 0

| A accepté

Réponse apportée
plot tools tick mark pi
t = linspace(0,2*pi,100) ; y = sin(t) ; plot(t,y,'bo-') ; set(gca,'xtick',[0:pi:2*pi]) % where to set the tick marks ...

presque 10 ans il y a | 2

Réponse apportée
How to plot the graph of Greatest Integer Function ?
x=linspace(1,10,10) y=floor(x) % ARE THESE VALUES AS EXPECTED?? stairs(x,y) % rather than stem

presque 10 ans il y a | 0

Réponse apportée
How to remove duplicate rows from a matrix, and forcing the matrix size to be 4?
You can get unique rows of a matrix A using B = unique(A,'rows') Subsequently, you can copy some rows from B to fill it ...

presque 10 ans il y a | 0

Charger plus