답변 있음
Storing values from for-loop into a matrix
In MATLAB array indices should be posititve integers, in the given code, i the loop index is used as index in T, V; i is not an ...

13일 전 | 1

|수락됨

답변 있음
Fit a least squares ellipse
Replace this line: A=R(1:6); with A=R(1,6); There is a typo error in getting A. A is a vector in your case, you arenot gett...

13일 전 | 0

|수락됨

답변 있음
Gather specially vector satisfied the condition
np=100; X = zeros(np) ; x = 1.5*randn(np,1); for i = 2:np X(:,i) = 0.5*(X(:,i-1)+randn(np,1)); end

13일 전 | 0

|수락됨

답변 있음
Calculate and plot the shortest distance (norm) between a point and a line in 3D space
It is an easy task to achieve. You can find the foot of the perpendicular. Refer this: https://www.toppr.com/ask/question/the-...

13일 전 | 0

답변 있음
Separating data into one-second intervals, and finding the maximum data in each interval
As you said data is from 40-80 seconds and each second has 1300 data points, you can pick the first 40*1300 rows and reshape the...

13일 전 | 1

답변 있음
Extract Cell Data Contain With Char
fg = {'07-Apr-2022'; '08-Apr-2022'; '09-Apr-2022'}; datetime(fg)

13일 전 | 0

|수락됨

답변 있음
why I can't export the training plot
Try: currentfig = findall(groot, 'Tag', 'NNET_CNN_TRAININGPLOT_UIFIGURE'); savefig(currentfig,['Training,','.fig']);

14일 전 | 1

답변 있음
Lines vanishing on plot when rescaling axes
I don't think they are vanishing...they might be mixing up with the already existing line: Try: plot(xdata, ydata1, 'k') hold ...

14일 전 | 0

답변 있음
How do I compute volume of a set 3-D point?
Read about trapz. Refer: https://in.mathworks.com/matlabcentral/answers/1455449-how-to-calculate-volume-of-surf-plot-3d-plot-e...

14일 전 | 0

|수락됨

답변 있음
Why I see only the last value of my row vector in the workspace?
You are using the vector as the loop index so obviously you will find only the last value. You can check it your self. for a =...

14일 전 | 0

|수락됨

답변 있음
How to find the mean of a column in a matrix using for loop?
TempSenVal=[58.3 59.2 60.2 63.0 63.3; 62.5 63.8 64.9 65.2 65.8;... 63.2 64.2 65.3 67.8 67.9; 64.0 65.1 67.8 68.2 69.1; 65.5...

14일 전 | 0

|수락됨

답변 있음
How to plot a color shade instead of graph curves?
How about this approach? load('p0_t.mat') ; x = t ; y0 = min(p0(:)) ; y1 = max(p0(:)) ; y = linspace(y0,y1,300) ; [X,Y...

14일 전 | 0

답변 있음
How to fit a curve into contour plot?
Get the contour line coordinates using the contour function and use polyfit. Read about polyfit.

15일 전 | 0

답변 있음
How to reshape matrix by column number?
需求= [1 780 0 0 0 0 0 0 0 8 45 0 1 79 0 0 0 0 31 8 0 0 0 0 0 1 80 456 0 4 0 39 0 0 0 16 0 0] ; n = size(dema...

15일 전 | 0

답변 있음
How to select the frame at the mouse click from a video?
REad about ginput and getpts.

15일 전 | 1

|수락됨

답변 있음
How to select points from a input video?
v = VideoReader(myvideo) ; n = 10 ; % say this the frame you want to read frame = read(v,n); imshow(frame) [x,y] = getpts ...

15일 전 | 0

|수락됨

답변 있음
Average a section of a column in a table base don another column values
[c,ia,ib] = unique(T3.index) ; N = length(c) ; iwant = zeros(N,1) ; for i = 1:N iwant(i) = mean(T3.value(ib==i)) ; end

15일 전 | 0

|수락됨

답변 있음
Using First Two Columns to Solve for Third
M = [0;30;90;180;200;350] ; e = [0.01;0.01;0.01;0.01;0.01;0.01] ; N = length(M) ; iwant = cell(N,1) ; for i = 1:N iw...

15일 전 | 0

답변 있음
Print value of correlation to a plot displaying two functions
R = corr(y1,y2,'Type','Kendall') ; figure(); hold on; plot(Year,y1); hold on; plot(Year,y1); str = sprintf('%f',R) ; ...

16일 전 | 0

|수락됨

답변 있음
how can i use a loop to run the specific code
ncFiles = dir('E:\data\2002\*.nc') N = length(ncfiles) ; Q = zeros(N,1) ; for i = 1:N ncFile = fullfile(ncFiles(i).fol...

16일 전 | 0

|수락됨

답변 있음
plot graph for multiple values for one of the variables on the same axis (and in different colours)
You have to initilaize the variables inside the loop. Read about initliaing an array in aloop. r1=18e-2; % inner radius of s...

16일 전 | 0

|수락됨

답변 있음
画一个圆,已知半径
th = linspace(0,2*pi)' ; R = 1; x = R*cos(th) ; y = R*sin(th) ; % make groups G = zeros(size(th)) ; G(th >= 0 & th < ...

17일 전 | 1

|수락됨

답변 있음
How to merge two matrix?
a=[6 6 5 6 5 6 6] ; b = [0.74 0.66 0.58 0.47 0.62 0.75 0.76] ; [c,ia,ib] = unique(a) ; N = length(c) ; G = cell(N,1)...

17일 전 | 0

|수락됨

답변 있음
How to create a cell array by repeating a row vector
A = 1:10 ; B = reshape(repelem(A,4,1),2,2,10) ; C = num2cell(B,[1 2]) ; celldisp(C)

17일 전 | 0

답변 있음
Graph plotting of f(x,y)=e^x+e^y using ezsurf
clear clc syms x y f=(exp(x)+exp(y)) ezsurf(f) colormap cool

17일 전 | 0

|수락됨

답변 있음
I want to get the result, not the graph, what to do
[f,xi] = ksdensity(x,x1);

17일 전 | 0

답변 있음
How to refill the Missing values to complete the sequence
Read about fillmissing. load('Values.mt') ; idx = Values == 4000 ; % get missing values i.e. 4000 Values(idx) = NaN ; % ...

18일 전 | 0

답변 있음
How to take monthly average from table?
Read about retime. https://in.mathworks.com/help/matlab/ref/timetable.retime.html

18일 전 | 0

답변 있음
How to find the closest value to the average in an array?
a = [1,2,3,4,5,6,7] ; [val,idx] = min(abs(a-mean(a))); a(idx)

19일 전 | 0

|수락됨

답변 있음
How to stop loop rewriting
notebook = readtable('notebook.xlsx'); filename = notebook.Filename; num_files = length(filename); exp = cell(1,num_files);...

19일 전 | 0

더로드