已回答

how to solve if interpolated data also contains NaN values

a = readmatrix("https://www.mathworks.com/matlabcentral/answers/uploaded_files/1641181/V2_small.txt"); a(a>9999.8) = nan b...

how to solve if interpolated data also contains NaN values

a = readmatrix("https://www.mathworks.com/matlabcentral/answers/uploaded_files/1641181/V2_small.txt"); a(a>9999.8) = nan b...

5 months 前 | 0

| 已接受

已回答

How to plot data from an external MAT file against a time domain?

If you want to plot whole time series: ns = length(icpcomposite); t = (0:ns-1)/fs; plot(t, icpcomposite); If you want to plo...

How to plot data from an external MAT file against a time domain?

If you want to plot whole time series: ns = length(icpcomposite); t = (0:ns-1)/fs; plot(t, icpcomposite); If you want to plo...

5 months 前 | 1

已回答

what is the meaning of int16>=int16

The following will read data from the file pointed by fid, assuming that the data in the file is of the format int16 and convert...

what is the meaning of int16>=int16

The following will read data from the file pointed by fid, assuming that the data in the file is of the format int16 and convert...

5 months 前 | 0

已回答

transfer numerical data end with 'M' and 'B'

You can define your own function. Here is an example: sprintfkmb(12345678) sprintfkmb(-12345678) sprintfkmb(-1238) sprintfk...

transfer numerical data end with 'M' and 'B'

You can define your own function. Here is an example: sprintfkmb(12345678) sprintfkmb(-12345678) sprintfkmb(-1238) sprintfk...

5 months 前 | 0

已回答

Unable to perform assignment because the left and right sides have a different number of elements.

The following line is problematic: back_to_zero_indices = find(g1(t_values(nonzero_indices)) == 0, 1, 'last'); First, the func...

Unable to perform assignment because the left and right sides have a different number of elements.

The following line is problematic: back_to_zero_indices = find(g1(t_values(nonzero_indices)) == 0, 1, 'last'); First, the func...

5 months 前 | 0

已回答

How can I set zlabel log scale on 3d plot

[X,Y,Z] = peaks(50); X = X - min(X(:)) + 1; % make it +ve for log Y = Y - min(Y(:)) + 1; Z = Z - min(Z(:)) + 1; surf(X, Y...

How can I set zlabel log scale on 3d plot

[X,Y,Z] = peaks(50); X = X - min(X(:)) + 1; % make it +ve for log Y = Y - min(Y(:)) + 1; Z = Z - min(Z(:)) + 1; surf(X, Y...

5 months 前 | 3

已回答

Finding the mean values of peak values using "findpeaks" function and displaying it

% load a1.mat % data = a1(:,2) % sample data x = linspace(0,1,1000); Pos = [1 2 3 5 7 8]/10; Hgt = [3 4 4 2 2 3]; Wdt ...

Finding the mean values of peak values using "findpeaks" function and displaying it

% load a1.mat % data = a1(:,2) % sample data x = linspace(0,1,1000); Pos = [1 2 3 5 7 8]/10; Hgt = [3 4 4 2 2 3]; Wdt ...

5 months 前 | 0

已回答

I am trying to color a box on a plot.

You can change the face color of the box: square = rectangle('Position', [0, 0, 2.5, 15], 'EdgeColor','b','LineWidth',2,"Fa...

I am trying to color a box on a plot.

You can change the face color of the box: square = rectangle('Position', [0, 0, 2.5, 15], 'EdgeColor','b','LineWidth',2,"Fa...

5 months 前 | 0

| 已接受

已回答

I am trying to color a box on a plot.

Try the following figure; an = annotation("textbox", "Color", "r", "BackgroundColor", "g", "String", "Text Box"); for i=0:0.0...

I am trying to color a box on a plot.

Try the following figure; an = annotation("textbox", "Color", "r", "BackgroundColor", "g", "String", "Text Box"); for i=0:0.0...

5 months 前 | 0

已回答

How to workaround this problem with angle?

You can try unwrap function. %total range of omega delta_omega=20; %intervals of omega that are used to approximate omega_pr...

How to workaround this problem with angle?

You can try unwrap function. %total range of omega delta_omega=20; %intervals of omega that are used to approximate omega_pr...

5 months 前 | 1

已回答

I want lo graph a interseccion

% x= 3 -y^2 y1 = (-3:0.02:3); x1 = 3 - y1.^2; % y = x -1 x2 = (-2:0.01:3); y2 = x2 -1; plot(x1, y1, 'r-', x2, y2, 'b...

I want lo graph a interseccion

% x= 3 -y^2 y1 = (-3:0.02:3); x1 = 3 - y1.^2; % y = x -1 x2 = (-2:0.01:3); y2 = x2 -1; plot(x1, y1, 'r-', x2, y2, 'b...

5 months 前 | 1

已回答

Finding array index for a given array element does not work all the time

Mind the round off error in searching double array mf = 0:0.001:0.6; i = find(abs(mf - 0.3910) < 1e-6)

Finding array index for a given array element does not work all the time

Mind the round off error in searching double array mf = 0:0.001:0.6; i = find(abs(mf - 0.3910) < 1e-6)

5 months 前 | 0

已回答

How can i plot a 3D graph using excel file?

x = readtable("https://www.mathworks.com/matlabcentral/answers/uploaded_files/1632251/data.xlsx"); waterfall(table2array(x)')...

How can i plot a 3D graph using excel file?

x = readtable("https://www.mathworks.com/matlabcentral/answers/uploaded_files/1632251/data.xlsx"); waterfall(table2array(x)')...

5 months 前 | 1

| 已接受

已回答

I have sigmoid graph and I want to stop the time until 4th and continue from day 10th until day 30th. Can I make like this?

M1(1)=0; t(1)=0; h=0.01; dt=-5:h:30; t=zeros(length(dt),1); M1=zeros(length(dt),1); for i= 1:length(dt) t(i+1)=t(i)+h...

I have sigmoid graph and I want to stop the time until 4th and continue from day 10th until day 30th. Can I make like this?

M1(1)=0; t(1)=0; h=0.01; dt=-5:h:30; t=zeros(length(dt),1); M1=zeros(length(dt),1); for i= 1:length(dt) t(i+1)=t(i)+h...

5 months 前 | 0

| 已接受

已回答

How to use a string to format multiple plots?

You can use cell array as the input arguments. Here is an example %tiledlayout(4,4) %Format='"linewidth",2'; %Arbitrary numb...

How to use a string to format multiple plots?

You can use cell array as the input arguments. Here is an example %tiledlayout(4,4) %Format='"linewidth",2'; %Arbitrary numb...

5 months 前 | 0

| 已接受

已回答

why cant I see any lines on the graph

It seems that the solution is not converging. Try setting an appropriate step size or other options to make it converging. % I...

why cant I see any lines on the graph

It seems that the solution is not converging. Try setting an appropriate step size or other options to make it converging. % I...

5 months 前 | 0

已回答

Adding a label with text on a plot

x = -3:.1:3 y = exp(-(x-0.5).^2/2); plot(x, y) % need to adjust the coordinates (normalized unit) % doc annotation for mor...

Adding a label with text on a plot

x = -3:.1:3 y = exp(-(x-0.5).^2/2); plot(x, y) % need to adjust the coordinates (normalized unit) % doc annotation for mor...

5 months 前 | 0

| 已接受

已回答

Hann window with a 2 km full width of window

N = 101; % Window length (# of points over -dz/2 to dz/2) w = hann(N); % hanning window plot(-(N-1)/2:(N-1)/2, w)

Hann window with a 2 km full width of window

N = 101; % Window length (# of points over -dz/2 to dz/2) w = hann(N); % hanning window plot(-(N-1)/2:(N-1)/2, w)

5 months 前 | 0

| 已接受

已回答

Color areas between two curves and the x and y-axis (not polynomial)

It seems that area function cannot individually change the basevalue (I have done some separate tests). One work around is to u...

Color areas between two curves and the x and y-axis (not polynomial)

It seems that area function cannot individually change the basevalue (I have done some separate tests). One work around is to u...

5 months 前 | 0

| 已接受

已回答

how can I read and draw a plot and histogram from txt file on Matlab.

a = readtable("testdata.txt"); a.MESS_DATUM = string(a.MESS_DATUM) histogram(a.DD_10, 5) % 5bins

how can I read and draw a plot and histogram from txt file on Matlab.

a = readtable("testdata.txt"); a.MESS_DATUM = string(a.MESS_DATUM) histogram(a.DD_10, 5) % 5bins

5 months 前 | 0

已回答

recreating in matlab Butterworth Filter filter response

It seems that there is a confusion in s-domain and omega domain. The following is the Laplace Transform in s-domain. The plott...

recreating in matlab Butterworth Filter filter response

It seems that there is a confusion in s-domain and omega domain. The following is the Laplace Transform in s-domain. The plott...

7 months 前 | 0

已回答

how can I calculate the nautical direction angle from Cartesian x- and y-component of velocity

vx = 10; vy = 10; v = sqrt(vx.^2 + vy.^2) theta = wrapTo360(90 - rad2deg(atan2(vy, vx))) % Earth coordinates, with ref to ...

how can I calculate the nautical direction angle from Cartesian x- and y-component of velocity

vx = 10; vy = 10; v = sqrt(vx.^2 + vy.^2) theta = wrapTo360(90 - rad2deg(atan2(vy, vx))) % Earth coordinates, with ref to ...

7 months 前 | 0

已回答

what is the map in this example?

"map" specifies the color of the image. load mri

what is the map in this example?

"map" specifies the color of the image. load mri

7 months 前 | 0

已回答

Hi I want to know how to do substract one data file from an another with a same resolution

depth = readmatrix("https://www.mathworks.com/matlabcentral/answers/uploaded_files/1577092/depth.txt"); depth_00001 = readmatri...

Hi I want to know how to do substract one data file from an another with a same resolution

depth = readmatrix("https://www.mathworks.com/matlabcentral/answers/uploaded_files/1577092/depth.txt"); depth_00001 = readmatri...

7 months 前 | 0

| 已接受

已回答

How to change the color of a rigidbody visual.

See below for the question (1). I am not sure the part (2) and you may want to show your current code. body1 = rigidBody('body...

How to change the color of a rigidbody visual.

See below for the question (1). I am not sure the part (2) and you may want to show your current code. body1 = rigidBody('body...

7 months 前 | 0

已回答

How to change the color of a rigidbody visual.

body1 = rigidBody('body1'); jnt1 = rigidBodyJoint('jnt1','revolute'); tform = trvec2tform([0 1 0]); setFixedTransform(jnt1,t...

How to change the color of a rigidbody visual.

body1 = rigidBody('body1'); jnt1 = rigidBodyJoint('jnt1','revolute'); tform = trvec2tform([0 1 0]); setFixedTransform(jnt1,t...

7 months 前 | 1

| 已接受

已回答

Matlab giving incorrect matrix multiplication :/

There is no problem for the matrix A and its inverse. Where do you get invA? A =[ 1 1 1 0 10 20 0 ...

Matlab giving incorrect matrix multiplication :/

There is no problem for the matrix A and its inverse. Where do you get invA? A =[ 1 1 1 0 10 20 0 ...

8 months 前 | 0

已回答

Is it possible to change scalar to numeric in workspace?

a = gpuArray(rand(3, 4, 2)); a(:,:,1) % use gather to convert gpu array to regular array b = gather(a(:,:,1))

Is it possible to change scalar to numeric in workspace?

a = gpuArray(rand(3, 4, 2)); a(:,:,1) % use gather to convert gpu array to regular array b = gather(a(:,:,1))

8 months 前 | 0

| 已接受

已回答

Hai i am trying to 'pcolor plot' for Time for 12 hrs(x-axis) and height(y-axis) height size [103 X 1].can you help me?please

t = (1:12); h = (1:103); z = exp(-h'.*t/200); % data p = pcolor(t, h, z); p.EdgeColor = "none"; clear load(websave("...

Hai i am trying to 'pcolor plot' for Time for 12 hrs(x-axis) and height(y-axis) height size [103 X 1].can you help me?please

t = (1:12); h = (1:103); z = exp(-h'.*t/200); % data p = pcolor(t, h, z); p.EdgeColor = "none"; clear load(websave("...

8 months 前 | 1

已回答

convert decimal to hex with 3 digit

dec2hex(-30) % this converts to hex in 2's complement hex2dec('E2') % this treats the hex as unsigned by d...

convert decimal to hex with 3 digit

dec2hex(-30) % this converts to hex in 2's complement hex2dec('E2') % this treats the hex as unsigned by d...

8 months 前 | 1

| 已接受