Réponse apportée
Updating variable after each loop iteration
generated_word='matlabcommunity' ; newChr=[]; promt = cell(length(generated_word),1) ; for i=1:length(generated_word) ...

presque 4 ans il y a | 0

Réponse apportée
Given a matrix, how can I slice a matrix given the input parameters are the number of rows and number of columns? See example.
Read about mat2cell. origImgMatrix = [2 4 6 8 9 2 3 4 1 4 9 8 3 9 1 4 ];...

presque 4 ans il y a | 0

Réponse apportée
Best fitting curve for variable data
% data x = [1.0779 1.2727 1.4700 1.5766 1.6471 1.7396 1.7828 1.8208 1.8370]' ; y = [7.9511 9.8400 ...

presque 4 ans il y a | 1

Réponse apportée
Plot only a part of the histogram
Read about xlim. xlim([-0.1 0.1])

presque 4 ans il y a | 0

| A accepté

Réponse apportée
MAKE Vector by loop and if statement
If you want to store the index: y = zeros([],1) ; u=length(Datatest.Timehhmm); count = 0 ; for i=1:u z= Datates...

presque 4 ans il y a | 0

Réponse apportée
Error on plotting (Index in position 1 exceeds array bounds. Index must not exceed 51.)
Simply try: surf(T_n)

presque 4 ans il y a | 1

| A accepté

Réponse apportée
Problems with a if statement in a for-loop
id = true(anzahl_runs,1) ; for k=1:anzahl_runs if any (intens_RL(k,:)==1) Ratio(k,1)=SpalteSr87(k,:)/SpalteSr86(...

presque 4 ans il y a | 2

| A accepté

Réponse apportée
Index exceeds the number of array elements. Index must not exceed 1 error
The function dxdtProb20222 needs input as x; x should be an array of size 1x6 or 6x1. It seems in your case x is of not that siz...

presque 4 ans il y a | 0

Réponse apportée
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 ...

presque 4 ans il y a | 1

| A accepté

Réponse apportée
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...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
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

presque 4 ans il y a | 0

| A accepté

Réponse apportée
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-...

presque 4 ans il y a | 0

Réponse apportée
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...

presque 4 ans il y a | 1

Réponse apportée
Extract Cell Data Contain With Char
fg = {'07-Apr-2022'; '08-Apr-2022'; '09-Apr-2022'}; datetime(fg)

presque 4 ans il y a | 0

| A accepté

Réponse apportée
why I can't export the training plot
Try: currentfig = findall(groot, 'Tag', 'NNET_CNN_TRAININGPLOT_UIFIGURE'); savefig(currentfig,['Training,','.fig']);

presque 4 ans il y a | 1

| A accepté

Réponse apportée
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 ...

presque 4 ans il y a | 0

Réponse apportée
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...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
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 =...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
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...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
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...

presque 4 ans il y a | 0

Réponse apportée
How to fit a curve into contour plot?
Get the contour line coordinates using the contour function and use polyfit. Read about polyfit.

presque 4 ans il y a | 0

Réponse apportée
How to reshape matrix by column number?
demand = [1 78 0 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...

presque 4 ans il y a | 0

Réponse apportée
How to select the frame at the mouse click from a video?
REad about ginput and getpts.

presque 4 ans il y a | 1

| A accepté

Réponse apportée
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 ...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Average a section of a column in a table based on 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

presque 4 ans il y a | 0

| A accepté

Réponse apportée
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...

presque 4 ans il y a | 0

Réponse apportée
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) ; ...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
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...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
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...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Drawing a circle with known radius
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 < ...

presque 4 ans il y a | 1

| A accepté

Charger plus