Réponse apportée
Matrix with the values of the loop
N = ... Value = nan(1,N) % pre-allocation, speeding things up for k=1:N % loop Value(k) = ... % calculation here ...

presque 10 ans il y a | 0

Réponse apportée
help with bar plotting?
Plot them in a single statement. Concatenate the X-values and the Y-values to do that: X = [2.84 3.834]; Y = [0.091713 1...

presque 10 ans il y a | 0

Réponse apportée
how can I multiply a vector by scalar?
C is a cell array. I think you want the content of a cell in C to be multiplied by 2.7. You can do this using cellfun C = {...

presque 10 ans il y a | 0

Réponse apportée
how to insert the column [60;80] into the third column
For what it is worth, take a look at INSERTROWS, which you can use with transpose to get "insertcolumns" after (or before) a spe...

presque 10 ans il y a | 0

Réponse apportée
how we can plot whole the ans
First I suggest you put the output of the function in a variable, so instead of using MyFunction(...) use Res...

presque 10 ans il y a | 0

Réponse apportée
How to convert "do loop" of fortran to matlab?
You have converted them to nested for-loops, in which the inner loop is executed multiple times. I think you want two separate l...

presque 10 ans il y a | 0

Réponse apportée
Develop an m-file function to compute v as a function of t. Develop a script to plot v versus t from t=-5 to 50 .
Create a function m-file like this: function Value = calculateValue (t) Value = zeros(size(t)) % default values ...

presque 10 ans il y a | 0

Réponse apportée
combination function using ndgrid
Take a look the content of ALLCOMB, which does exactly what you're after btw... <http://www.mathworks.com/matlabcentral/filee...

presque 10 ans il y a | 0

Réponse apportée
how to insert the column [60;80] into the third column
A = [1 5 6 ; 0 3 8] A(:,3) = [60 ; 80] % insert a vector in the 3rd column

presque 10 ans il y a | 0

Réponse apportée
How to generate Combination of special sets and subsets
This is called a circulant matrix. I have written a function that can be found in the File Exchange: A = [100 125 300 400] ...

presque 10 ans il y a | 0

| A accepté

Réponse apportée
How to generate Combination of special sets and subsets
Found both of them :D <</matlabcentral/answers/uploaded_files/52544/found.png>>

presque 10 ans il y a | 0

Réponse apportée
Deleting rows until a certain point
Perhaps this example can help you: % some data t = 1:15 ; v = [0 0 0 0 1 2 4 8 4 2 0 -2 -4 -8 -4] % find the point...

presque 10 ans il y a | 1

| A accepté

Réponse apportée
Average over a cycle
First, do not name your products like this. Use the cell array directly with indexing, or convert to a struct. A solution to ...

presque 10 ans il y a | 1

Réponse apportée
Matrix dimensions to create for loop?
You can use a for-loop: rr = rand(6,200) ; [nr,nc] = size(rr) ; X = eye(nr,1) ; % take it out of the loop V =...

presque 10 ans il y a | 0

Réponse apportée
Extract individual numbers from a list
Do not do this! It is the contents of a variable that should change, not the name of the variable itself. An example in real ...

presque 10 ans il y a | 0

| A accepté

Réponse apportée
How to attribute numeric values to a function?
Why store the result in a different variable V = input('Enter a number: ') ; switch (V) case 1 out = sin(2) ; ...

presque 10 ans il y a | 1

Réponse apportée
How to multiply elements of a cell array with each other?
You should be aware that matrix multiplication is not commutative (A*B does not equal B*A, in general). A for-loop is the best o...

presque 10 ans il y a | 1

| A accepté

Réponse apportée
From this matrix pattern, how to create a matrix iterations automatically? Thanks guys
V = [-3 1 0 0 0] M = toeplitz(V,V)

presque 10 ans il y a | 0

Réponse apportée
Sampling from distribution summing up to some value
The arguments of GAMRND are the shape parameters of the distribution. Change them and you will change the distribution from whic...

presque 10 ans il y a | 1

| A accepté

Réponse apportée
'Grid Vectors not strictly monotonic increasing'
This happens when values in X are not unique X = [1 2 3 3 4 5] Y = [10 20 28 32 40 50] interp1(X,Y, 3.5) A workaro...

presque 10 ans il y a | 1

| A accepté

Réponse apportée
How to name/number each line graph in Y axis, instead of the 1-9 numbers?
use the function *text* text(X, Y, STR) will place the string STR at the location (X,Y) on the current axes.

presque 10 ans il y a | 0

| A accepté

Réponse apportée
Average value of an annulus in a square matrix
R = 3 ; M = magic(2*R+1) ; dr = 1 ; [ri,ci] = ndgrid(1:(2*R+1)) D = hypot(ri-R-1,ci-R-1) for k=dr:dr:R ...

presque 10 ans il y a | 0

Réponse apportée
Can someone help me with my if statements in my function?
I quickly see three issues: # a is always positive so b can never be both positive (>=2*a) and negative (<= 0). # for A = s...

presque 10 ans il y a | 0

| A accepté

Réponse apportée
How can I export a matrix as a CSV file?
You and your computer disagree on what to use as a decimal symbol: a . or a , I strongly recommend you to use a decimal point...

presque 10 ans il y a | 2

Réponse apportée
Ttest for one row of matrix
A simple for-loop would do: Nrows = size(DATA,1) h = zeros(Nrows,1) for k = 1:Nrows h(k) = ttest(DATA(k,:)) e...

presque 10 ans il y a | 0

| A accepté

Réponse apportée
Computing the difference vector for all possible pairs of columns in a matrix?
Take a look at NCHOOSEK A = [1 2 3 4 ; 10 8 6 4 ; 11 23 35 47] ColIdx = nchoosek(1:size(A,2),2) B = A(:,ColIdx(:,1)) ...

presque 10 ans il y a | 0

| A accepté

Réponse apportée
genvarname({'A', 'A', 'A', 'A'});
GENVARNAME will become obsolete pretty soon. This is more flexible: C = arrayfun(@(k) sprintf('Sensor%02d',k), 7:13, 'un',0...

presque 10 ans il y a | 0

Réponse apportée
genvarname({'A', 'A', 'A', 'A'});
Why do you want to do this? It is generally a very bad programming idea to generate variable names like this. *"It is the con...

presque 10 ans il y a | 0

Réponse apportée
i have an array, named ersum which have 20000 columns (1*20000). i need to find minimum value of first 50 columns. next minimum value of next 50 columns and so on upto last 50 in that 20000 columns. please send suitable code. thank you sir.
you can RESHAPE your vector into a 50-by-N array and then use MIN which can operate on all columns at once. help reshape ...

presque 10 ans il y a | 1

Réponse apportée
How to do "the black top-hat transformation"
<http://uk.mathworks.com/help/images/ref/imtophat.html>

presque 10 ans il y a | 0

Charger plus