Réponse apportée
How can I generate random integers from 1 to 'n' in a jagged array(matrix of different row size) ?
Read about randperm. If you want to select 4 numbers from 1 to 15. r = randperm(15,4)

presque 4 ans il y a | 0

Réponse apportée
Stuck at coding newton-Rapson method
Replace this line: f2=diff(f(x)); with f2=inline(diff(f(x)));

presque 4 ans il y a | 1

Réponse apportée
Hello to all, can you help me to plot y= (x+2)^(x+2)
x = linspace(0,1) ; y = (x+2).^(x+2) ; plot(x,y)

presque 4 ans il y a | 0

| A accepté

Réponse apportée
a function that has two inputs: a number and a row vector
function val = myfun(a,b) if numel(a) ~= 1 | size(b,1) ~=1 error('check the inputs') ; end % Do what you want end

presque 4 ans il y a | 0

Réponse apportée
How to add a row above the first row of a matrix to name each column
tc = (0:15:100)'; % tc is temperature Celsius, tf is temp deg F, tf = 1.8.*tc + 32; % and tr is temp deg Rankin. tr = tf + 459...

presque 4 ans il y a | 0

Réponse apportée
How to plot the y and t?
You need to call the function. Provide the input and call the function. There is small typo in your function; it seems the input...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Error in plot... vectors must be same length
These lines: N=30; %no of divisions; l=30; delta_x=l/N; M(1,1)=0; N(1,1)=1; % <---- over writitng values of N Why you...

presque 4 ans il y a | 0

Réponse apportée
Not enough input Arguments Error & error in Height
Note that height is a inbuilt function. You have not defined the variable height which is defined in the line: MoR = ((testload...

presque 4 ans il y a | 1

Réponse apportée
How do you call local functions?
function radius = r(x) SA = 4*pi*r^.2; V = (4/3)*pi*r^.3; end Save the above function inti a file r.m. (I suggest bi...

presque 4 ans il y a | 0

Réponse apportée
Error while using pdist function
You cannot use whatever the word you want. There are specified words which are methods of getting the distance. X=[1,1;2,2;3,3...

presque 4 ans il y a | 1

Réponse apportée
how to change value in particular column in csv file
You can read the csv files using csvread or readtable. Let A be your column. B = A ; B(A>700) = 1; B(A<700) = 1; iwant = ...

presque 4 ans il y a | 0

Réponse apportée
add legend after a loop
May be something like below: figure(1) hold on for k=0:20 p=[1 2 4 k] ; r=roots(p); plot(r,'*','DisplayN...

presque 4 ans il y a | 0

Réponse apportée
How do I double the size of a given matrix?
A = [ 1 2 3 4] ; iwant = repelem(A,2,1)

presque 4 ans il y a | 0

Réponse apportée
How do I create multiple figure of cwt in for loop and save them on folder
May be you need th add the below shown line after loading the data from mat file. load Data_segment Data_segment = New_data ;...

presque 4 ans il y a | 0

Réponse apportée
Trying to create a random date using randi and if-elseif-else statements
theday = randi(31) ; % random day out of 31 days themonth = randi(12) ; % random month out of 12 months theyears = 1980:2...

presque 4 ans il y a | 1

Réponse apportée
How to create an Nn x Nn matrix from N number of matrices of n x n size each?
m = fix(samples/3) ; signma = cell(m) ; for i=1:m for j=1:m if i==j sigma{i,j}=Xv(:,i); ...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Get index of an x, y data point via user selection in a plot.
% random points for demo x = rand(10,1) ; y = rand(10,1) ; % Scatter plot scatter(x,y) % clicks by the user [xi,yi] = ...

presque 4 ans il y a | 0

Réponse apportée
How to move array element
A = [1 1 0 0 ;1 1 1 0 ;0 0 0 0 ;0 0 0 0] ; B = [0 0 0 0 ;0 1 1 0 ;0 1 1 1 ;0 1 0 0] ; C = [1 1 0 0 ;1 1 1 0 ;0 1 1 1 ;0 1 0 ...

presque 4 ans il y a | 0

Réponse apportée
Why am I getting Error "Array indices must be positive integers or logical values"?
You have not given/ shown us the function MyCenteredDifference, so we cannot check the function. But the error is simple and sta...

presque 4 ans il y a | 0

Réponse apportée
can anyone help how add zero padding
May be you are typing ans = in the workspace. You just need to type ans. A = rand(10) ; size(A) ans % no error You have t...

presque 4 ans il y a | 0

Réponse apportée
How to reverse the Y axis direction in a parallel plot?
figure(1) plot(rand(1,10)) figure(2) plot(rand(1,10)) set(gca, 'YDir','reverse')

presque 4 ans il y a | 0

Réponse apportée
How to save structure data to excel in matlab?
Read about double, vpasolve. double(A1s.A1)

presque 4 ans il y a | 0

| A accepté

Réponse apportée
How to generate 2D grid map inside of a patch area
Read about inpolygon.

presque 4 ans il y a | 0

Réponse apportée
Assigning Null / Multi-Dimensional Matrix
A = repmat(1:5,4,1) A(:,1:3) = []

presque 4 ans il y a | 0

Réponse apportée
Reduce a matrix to unique values, randomly choose which values are discarded
Read about unique. This will give indices of unique numbers and repitions. Run a loop for each unique row, use randi and get t...

presque 4 ans il y a | 0

Réponse apportée
Error using reshape-I'm not sure whats causing the issue
Your zeta is a function handle which gives you 4x4 matrix. You cannot plot it using plot. Check: t=1:0.01:3; for i = 1:leng...

presque 4 ans il y a | 1

Réponse apportée
Extract only some specific elements of the arrays of a cell
C = cell(5,1) ; for i = 1:5 C{i} = rand(1,3) ; end idx = [2 5 1] ; iwant = C(idx)

presque 4 ans il y a | 0

Réponse apportée
i am getting this error "Brace indexing is not supported for variables of this type" at line which contains (S_bar{i}=R{i}*T_1{i}*R_1{i}*S{i}*T{i});.
IN this line: S_bar{i}=R{i}*T_1{i}*R_1{i}*S{i}*T{i}; S is a matrix not a cell. So replace it by: S_bar{i}=R{i}*T_1{i}*R_1{i}*...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
How to read The value shown for R in 10^n
Your r, p are 2*1 double arrays. Type: whose r p If you want to extract each element, you can by using r(1) r(2) p(1) p...

presque 4 ans il y a | 0

Réponse apportée
Plotting of solutions using Newton Raphson method for a nonlinear function
Refer this: https://in.mathworks.com/matlabcentral/answers/107508-solving-a-nonlinear-equation-using-newton-raphson-method SEa...

presque 4 ans il y a | 0

Charger plus