A répondu
How to plot multiple iterations of a for loop on the same axes.
figure hold on for ... plot ... end title xlabel ylabel

environ 10 ans il y a | 1

| A accepté

A répondu
[HELP] How to seperate cell with values greater than 230 into new cell.
Not efficent, but it will do the job: v = {231.06;231.37;227.39;227.8} thresh = 230; vidx = cellfun(@(x) x > thresh, ...

environ 10 ans il y a | 1

| A accepté

A répondu
How to interpret matrix indexation? Help to translate specific case please.
You create a a 3dimesional matrix with the repmat: 3x3x2 The last line of code takes the matrix assigned on 3rd dimesion= 1 a...

environ 10 ans il y a | 1

| A accepté

A répondu
Alternative to the sym function
Something like this displays your matrix, but this is *display purpose only* s = sprintf( 'A=[\n') for i= 1: 10 s= ...

environ 10 ans il y a | 1

A répondu
summation operation in matlab
You must define _i_ as a symbolic variable too, otherwise _i_ is defined as the sqrt(-1) syms A i N = 6; Pb = (A.^N/f...

environ 10 ans il y a | 0

A répondu
element in matrix multiplication to create a new matrix
Your code doesn't run because you are using .* which is element wise multiplication instead of standar matrix multiplication. Yo...

environ 10 ans il y a | 0

| A accepté

A répondu
how to load .mat file into a function
function myfunction(myMat) load(myMat); %your code you call your function as: myfunction('path/MyMat.mat')

environ 10 ans il y a | 5

A répondu
How can I write the following matrix?
x = sym('x', [10 1]); y = sym('y', [10 1]); if true A = [x(1)^2 x(1)*y(1) y(1)^2 x(1) 1; x(2)^2 x(2)*y(2) y(...

environ 10 ans il y a | 0

| A accepté

A répondu
Reusing a calculated variable twice?
when you use "syms" is to create symbolic variables. clear g=9.81; h=10; u=1.5; syms a b c d a=u./sqrt(g.*...

environ 10 ans il y a | 0

A répondu
"In an assignment A(I) = B, the number of elements in B and I must be the same" and cant work out why
k1 is the output of _fun_ so it's an array, it has 2 values. So, when you call fun(f(i)+k1/2,xp(i)+k1/2) you are tryi...

environ 10 ans il y a | 0

A répondu
How do I store each output of my function as an vector element?
I guess there are more efficient ways to do it, but have you try a simple for loop? for i=1:150 [tau(i),doppler(i)...

environ 10 ans il y a | 0

| A accepté

A répondu
calculate an angle and distance from three points
The distance can be calculated as the norm of the vector between two points: P1 = [2; 50], P2 = [9; 40], P3 = [5; 20] ...

environ 10 ans il y a | 1

A répondu
These are 2 subprograms i have used to define 2 function grad and fnc. I have called the function grad , and in the function grad fnc is called, now x is a vector, and fnc is a scalar function of a vector variable still it is returning a vector
The problem is that _fnc_ is an input for grad, so _fnc_ is a variable from now on. When you try to call _fnc(x)_, MATLAB thinks...

environ 10 ans il y a | 0

A répondu
index must be a positive integer or logical.
A solution is this: c1=3.29; c2=9.90; c3=0.77; c4=0.20; Ln=zeros(1,length(t)); t= 0:-0.1:-1; %definition of...

environ 10 ans il y a | 0

A répondu
How to do surf plot if Z is not a matrix?
Let's assume _a_ is a number. There is a value of Z for every (X,Y), thus, Z is a matrix and it has same size as X. a = 1...

environ 10 ans il y a | 1

A répondu
Matlab source code for file selection
Hi, If I understood correctly you want to read the files from the folder Snaps, subsample them and then save them on a new f...

environ 10 ans il y a | 0

| A accepté

A répondu
restarting a while loop without finishing the remaining code.
Just in case you need the solution to your problem. You wanna break the while loop when all the values are not positive, so, y...

environ 10 ans il y a | 0

A répondu
How to efficiently pass large constant matrix in parfor
You can use global variables on parfor but, you cannot define global variables or persistent variables within the body of the pa...

environ 10 ans il y a | 0

A répondu
restarting a while loop without finishing the remaining code.
continue command restart the while loop. When condition holds the code after the if will not be run. while(1) %%yo...

environ 10 ans il y a | 0

| A accepté

A répondu
Two identical commands take different times to run?
When you create a 2D array, you need to reference each element to its memory address. As a result, for a 2D array, you need to a...

environ 10 ans il y a | 0