Risposto

Finding maximum value and it's location from the matrix

Try this: K = [... 8 16 -16 -8 -16 16 -20 -40 40 18 2 -6 -18 -2 6 -45 ...

Finding maximum value and it's location from the matrix

Try this: K = [... 8 16 -16 -8 -16 16 -20 -40 40 18 2 -6 -18 -2 6 -45 ...

circa 9 anni fa | 18

| accettato

Risposto

how do i put iteration values into a vector?

X = 0; xold=x0; xa=x1-(f(x1)*(x1-xold))/(f(x1)-f(xold)); iter=0; X(iter + 1) = xa; while abs(xa-xold)>=D; ...

how do i put iteration values into a vector?

X = 0; xold=x0; xa=x1-(f(x1)*(x1-xold))/(f(x1)-f(xold)); iter=0; X(iter + 1) = xa; while abs(xa-xold)>=D; ...

circa 9 anni fa | 0

Risposto

How do I change color of a text in a given subplot?

you can change text color as follow: x = -pi:.1:pi; y = sin(x); plot(x,y) text(-pi/4, sin(-pi/4), '\leftarrow sin(...

How do I change color of a text in a given subplot?

you can change text color as follow: x = -pi:.1:pi; y = sin(x); plot(x,y) text(-pi/4, sin(-pi/4), '\leftarrow sin(...

circa 9 anni fa | 1

Risposto

how to draw two graphs on same figure in matlab

x1 = 0:10; y1 = randi(100, 1, numel(x1)); x2 = 0:100; y2 = randi(100, 1, numel(x2)); plot(x1, y1, x2, y2)

how to draw two graphs on same figure in matlab

x1 = 0:10; y1 = randi(100, 1, numel(x1)); x2 = 0:100; y2 = randi(100, 1, numel(x2)); plot(x1, y1, x2, y2)

circa 9 anni fa | 0

Risposto

Why won't MATLAB see the two strings that I am comparing as equal?

replace m with v in your last if-else structure as follow: if isequal(v,'m^3') p2 = p1; elseif isequal(...

Why won't MATLAB see the two strings that I am comparing as equal?

replace m with v in your last if-else structure as follow: if isequal(v,'m^3') p2 = p1; elseif isequal(...

circa 9 anni fa | 0

| accettato

Risposto

to save time the mistake is in this line how can i solve it

perhaps * or / is missing omega=(pi/tmax)*(0:nt/2-1) .* or ./ (-nt/2:-1);

to save time the mistake is in this line how can i solve it

perhaps * or / is missing omega=(pi/tmax)*(0:nt/2-1) .* or ./ (-nt/2:-1);

circa 9 anni fa | 0

Risposto

I have data point which fits the line y=mx+c ? How can I write code for this?

write as follow x = 0:100; m = 3; c = 4; y = m * x + c; plot(x, y)

I have data point which fits the line y=mx+c ? How can I write code for this?

write as follow x = 0:100; m = 3; c = 4; y = m * x + c; plot(x, y)

circa 9 anni fa | 1

Risposto

How do I fit a sinusoidal curve to data? Trouble with fitit

you can try curve fitting tool for this purpose. See doc cftool And you can try different kind of curve fittings by you...

How do I fit a sinusoidal curve to data? Trouble with fitit

you can try curve fitting tool for this purpose. See doc cftool And you can try different kind of curve fittings by you...

circa 9 anni fa | 0

Risposto

How to increment a vector

you can do it in a loop as follows: A = [0 0 0 0]; B = [0 0 0 0]; lim = 0.999; inc = 0.001; count = 1; tic ...

How to increment a vector

you can do it in a loop as follows: A = [0 0 0 0]; B = [0 0 0 0]; lim = 0.999; inc = 0.001; count = 1; tic ...

circa 9 anni fa | 1

| accettato

Risposto

How can connect two point in plot graph?

yes. see: x = [0, 1]; y = [0, 5]; plot(x, y, '*-'), xlim([-1 2]), ylim([-1 6])

How can connect two point in plot graph?

yes. see: x = [0, 1]; y = [0, 5]; plot(x, y, '*-'), xlim([-1 2]), ylim([-1 6])

circa 9 anni fa | 0

| accettato

Risposto

How to plot a text data column from an excel file in MATLAB?

you can do it as follows: [num, txt, raw] = xlsread('filename.xlsx', 1); plot(num) set(gca,'Xtick',1:numel(num),'XTic...

How to plot a text data column from an excel file in MATLAB?

you can do it as follows: [num, txt, raw] = xlsread('filename.xlsx', 1); plot(num) set(gca,'Xtick',1:numel(num),'XTic...

circa 9 anni fa | 1

Risposto

I feel like my code is too long for what it tries to do, how can I make it shorter?

you can reduce it as follow: function YourFunctionName a = 4; b = 0.5; StepSize = [0.5, 5, 10]; for x = 1:numel...

I feel like my code is too long for what it tries to do, how can I make it shorter?

you can reduce it as follow: function YourFunctionName a = 4; b = 0.5; StepSize = [0.5, 5, 10]; for x = 1:numel...

circa 9 anni fa | 0

Risposto

I have 6 hourly data set , with 4 entries for a day, 6,12,18,24. I want a daily data set with a single data for a day, Time series is given below

you can do it as follow: fid = fopen('filename.txt'); a = textscan(fid, '%f%f%f%f%f%f%f'); % read file fclose(fid); ...

I have 6 hourly data set , with 4 entries for a day, 6,12,18,24. I want a daily data set with a single data for a day, Time series is given below

you can do it as follow: fid = fopen('filename.txt'); a = textscan(fid, '%f%f%f%f%f%f%f'); % read file fclose(fid); ...

circa 9 anni fa | 0

Risposto

i need matlab code for 50 random user locations, 8 Access Points and 1 Base Station on one plane....using m file

you can do it like this: figure('Color', 'white') UserLocationX = randi(50, 1, 50); UserLocationY = randi(50, 1, 50)...

i need matlab code for 50 random user locations, 8 Access Points and 1 Base Station on one plane....using m file

you can do it like this: figure('Color', 'white') UserLocationX = randi(50, 1, 50); UserLocationY = randi(50, 1, 50)...

circa 9 anni fa | 0

| accettato

Risposto

How do I eliminate strings with length < 3 from cellarray

try this: days = {'Monday', 'M', 'T', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'}; count = 1; for i = 1:length(days...

How do I eliminate strings with length < 3 from cellarray

try this: days = {'Monday', 'M', 'T', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'}; count = 1; for i = 1:length(days...

circa 9 anni fa | 0

Risposto

Replacing non-integer values

If *'a'* is your array then use the following: a(arrayfun(@(x) ~isinteger(x), a)) = 0;

Replacing non-integer values

If *'a'* is your array then use the following: a(arrayfun(@(x) ~isinteger(x), a)) = 0;

circa 9 anni fa | 0

Risposto

How can I set the value of Extrapval in interp2?

you should use value *0* *or* *255* for *extrapval* depending upon the image intensity values you are dealing with

How can I set the value of Extrapval in interp2?

you should use value *0* *or* *255* for *extrapval* depending upon the image intensity values you are dealing with

circa 9 anni fa | 0

Risposto

How to set that image to 0 (false) at those locations, instead of plotting a marker over them? That would break it apart.

try this: n = 50 ; A = double( rand(n, n+1) > 0.5 ) ; B = 2*A - 1 ; patterns = {[1 0 1; 0 1 0; 1 0 1]; ... % X ...

How to set that image to 0 (false) at those locations, instead of plotting a marker over them? That would break it apart.

try this: n = 50 ; A = double( rand(n, n+1) > 0.5 ) ; B = 2*A - 1 ; patterns = {[1 0 1; 0 1 0; 1 0 1]; ... % X ...

circa 9 anni fa | 0

Risposto

represent symbolic toolbox as a string

try this: syms r theta phi x=r*cos(theta)*cos(phi) y=r*sin(theta)*cos(phi) z=r*sin(phi) Array1 = ch...

represent symbolic toolbox as a string

try this: syms r theta phi x=r*cos(theta)*cos(phi) y=r*sin(theta)*cos(phi) z=r*sin(phi) Array1 = ch...

circa 9 anni fa | 0

Risposto

I need to repeat two signals combined periodically as a single curve in matlab

you can do something like this: for i = 0:4 * pi:16 * pi t1 = linspace(i, i + 2 * pi, 100); y1 = sin(t1); ...

I need to repeat two signals combined periodically as a single curve in matlab

you can do something like this: for i = 0:4 * pi:16 * pi t1 = linspace(i, i + 2 * pi, 100); y1 = sin(t1); ...

circa 9 anni fa | 0

| accettato

Risposto

How can I find maxima and minima points of intensity plot of one row of an image?

you can use max(i) % to find maximum value in a row/column vector and min(i) % to find minimum value in a row/col...

How can I find maxima and minima points of intensity plot of one row of an image?

you can use max(i) % to find maximum value in a row/column vector and min(i) % to find minimum value in a row/col...

circa 9 anni fa | 0

Risposto

missing value in TEXT file in matlab

For importing text type data you can use different functions like: textscan dlmread importdata fscanf fread ...

missing value in TEXT file in matlab

For importing text type data you can use different functions like: textscan dlmread importdata fscanf fread ...

circa 9 anni fa | 0

| accettato

Risposto

"Meshgrid" in more than 3 dimensions?

ndgrid is useful for you. See following link for more information: <http://www.mathworks.com/help/matlab/ref/ndgrid.html>

"Meshgrid" in more than 3 dimensions?

ndgrid is useful for you. See following link for more information: <http://www.mathworks.com/help/matlab/ref/ndgrid.html>

circa 9 anni fa | 0

Risposto

How to set all elements in a 2D Matrix between two indices to "1" in each row

you can do it as follow: for i = 1:size(A, 1) idx = find(A(i, :)); A(i, min(idx):max(idx)) = 1; end

How to set all elements in a 2D Matrix between two indices to "1" in each row

you can do it as follow: for i = 1:size(A, 1) idx = find(A(i, :)); A(i, min(idx):max(idx)) = 1; end

circa 9 anni fa | 0

Risposto

How to convert a matrix of double to int?

you can do it as follow: a = randi(100, 4); a = int64(a); see following link for more information about integer data ...

How to convert a matrix of double to int?

you can do it as follow: a = randi(100, 4); a = int64(a); see following link for more information about integer data ...

circa 9 anni fa | 0

Risposto

Call one array from a large array made up of several others

you can do it fi you store your arrays A, B, C and D in cell array Z as follows: Z = {A, B, C, D}; then you can treat A,...

Call one array from a large array made up of several others

you can do it fi you store your arrays A, B, C and D in cell array Z as follows: Z = {A, B, C, D}; then you can treat A,...

circa 9 anni fa | 0

| accettato

Risposto

Is there a functional approach to terminate running matlab script or function (similar to pressing Control+C)?

you can use 'quit' or 'exit'. See folowwing links for more information: <http://www.mathworks.com/help/matlab/ref/exit.html> ...

Is there a functional approach to terminate running matlab script or function (similar to pressing Control+C)?

you can use 'quit' or 'exit'. See folowwing links for more information: <http://www.mathworks.com/help/matlab/ref/exit.html> ...

circa 9 anni fa | 0

Risposto

How to clear persistent variables?

you can use: clear YourVariableName see for more information: <http://www.mathworks.com/help/matlab/ref/clear.html>

How to clear persistent variables?

you can use: clear YourVariableName see for more information: <http://www.mathworks.com/help/matlab/ref/clear.html>

circa 9 anni fa | 0

Risposto

Max sum of array elements with condition

you can do something like this: Matrix{1,1} = {'start index'}; Matrix{1,2} = {'end index'}; Matrix{1,3} = {'sum'}; ...

Max sum of array elements with condition

you can do something like this: Matrix{1,1} = {'start index'}; Matrix{1,2} = {'end index'}; Matrix{1,3} = {'sum'}; ...

circa 9 anni fa | 0

Risposto

How to read complex number from a *.csv file?

you can do it as follows: [num, str, raw] = xlsread('filename.csv'); a = str2num(cell2mat(raw));

How to read complex number from a *.csv file?

you can do it as follows: [num, str, raw] = xlsread('filename.csv'); a = str2num(cell2mat(raw));

circa 9 anni fa | 0