Answered
write values of different programm in next row of a text file
Tou need to use '\n' in fprintf to write in the next line of the file. Read about fprintf. fprintf('new line\n') fprintf('Hel...

5 years ago | 0

Answered
How to save each result of iteration?
n = 10 ; A = zeros(n,1) ; B = 23 ; for i = 1:n A(i) = i*B ; end No loop needed. A = (1:10)*23 ;

5 years ago | 1

| accepted

Answered
how to interpolate for increasing - decreasing type of data set
rpm1=[1000,2000,2500,3000,3500,4000,4500,4750,5320,5800,6000]; %engine rpm from table theta1=[100;80;60;40;20;1]; %throttl...

5 years ago | 0

Answered
Make elements of matrix ones
A = zeros(248,286); %create matrix of zeros A(20:60,[124:134 144:154 164:174]) = 1 ; %north: rectangles 40 pixels long and 10...

5 years ago | 0

| accepted

Answered
What does regression value in neural networks denote
Regression shows you how close the two datasets are. Regresion lies between [0,1]. The more the value the close the two datasets...

5 years ago | 1

| accepted

Answered
How measure a 0.5 delta of a vector?
Come on.....it is a simple one. Read some basics of MATLAB. x = rand(10,1) ; iwant = 1/2*log(x)

5 years ago | 0

| accepted

Answered
How to create a matrix with a for- loop
A = zeros(3) ; A(1,:) = 1 ; A(3,:) = 1 ; A

5 years ago | 0

Answered
How to find (x,y) coordinates of white pixel.
I0 = imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/670538/image.png') ; I1 = rgb2gray(I0) ; I2 = im...

5 years ago | 0

Answered
How to plot monthly data for 31 years on the same plot?
Let T be your table. thedates = T.(1) ; val = T.(3) ; [Y,MO,D,H,MI,S] = datevec(thedates) ; [c,ia,ib] = unique(Y) ; fi...

5 years ago | 0

Answered
an average curve for multiple curves (with different lenghts)
You do the interpolation and get all the curves to the same size. Read about interp1.

5 years ago | 0

Answered
How do i step from a bigger number to a smaller number ?
x = 2:-0.01:1

5 years ago | 0

Answered
BEST FIT OF SCATTERED DATA
Let (x,y) be your points. p = polyfit(x,y,1) ; % change the degree yi = polyval(p,x) ; plot(x,y,'.r',x,yi,'b')

5 years ago | 1

| accepted

Answered
Plot a cylinder surface with axis along a line
Read about the function cylinder. This will give you cylinder. Define your rotation marix, with the required angle and rotate th...

5 years ago | 0

Answered
How to arrange datetime vertically
t0 = datetime(2012,1,1) ; t1 = datetime(2021,12,31) ; t = (t0:t1)' ; t(1:10)

5 years ago | 0

Answered
Index exceeds the number of array elements (2).Please help ?
Check your syntax. Indexing should be integers not strings. When you use ' ', this will be a string. h=1; Ha=[-0.5;0.5]*h; fo...

5 years ago | 0

| accepted

Answered
How to create cirlces in matlab?
YEs you can draw such circles, using: th = linspace(0,2*pi) ; r = 1; c = [ 0 0] ; x = c(1)+r*cos(th) ; y = c(2)+r*sin(t...

5 years ago | 1

| accepted

Answered
Why my graph only get one line?
You have used clf....remove this

5 years ago | 0

Answered
Matlab animation for x y plot that is updated based on timestamps
Read about comet3. https://in.mathworks.com/help/matlab/ref/comet3.html If you want to save it as an animation, consider wri...

5 years ago | 0

Answered
Input grid is not a valid MESHGRID
A= loadvec('2009-08-07_measurements_22mi_e16900.T001.D001.P001.H001.L.vec'); [X,Y] = meshgrid(A.x,A.y); Xprime = X ; Yprime =...

5 years ago | 0

| accepted

Answered
Plotting xlsx file data using a for loop
Allpops=xlsread('pops.xlsx'); T = (1961:2020)' ; %I need a for loop to create exp1 fits for all of them and plot these fits %...

5 years ago | 0

| accepted

Answered
How can I use the inpolygon function for 3 dimensions?
You need not to use a 3D inpolygon. You are supposed to use inpolygon only once. Get your closed polygon coordinates(xv,yv); let...

5 years ago | 0

| accepted

Answered
How can I make 80 percent of the matrix values equal to zeros, randomly?
A = rand(30,20); % Matrix for demo B = A ; idx = randperm(numel(A),round(numel(A)*80/100)) ; % get 80% of indices randomly...

5 years ago | 0

| accepted

Answered
How to Fill matrix rows with another row?
Let A be your matrix. [m,n] = size(A) ; for i = 1:m if ~any(A(i,:)) A(i,:) = A(i-1,:) ; end end

5 years ago | 0

| accepted

Answered
How can I reduce the for loop number?
x_data = [2 6 7 9; 4 9 11 14]; y_data = [8 10 16 31; 15 18 21 24]; x = zeros(size(x_data)) ; y = zeros(size(x_data)) for i =...

5 years ago | 0

| accepted

Answered
could anyone help me how to validate the neural network
Read the documentation of TrainNetwork, you can pass the validation data to the function.

5 years ago | 0

Answered
"Index exceeds the number of array elements (4)." I want to display the calculated data that has been processed but there is an error why?
You are trying to extract more number of elements than present in array. Demo a = rand(1,4) ; a(1) % no error a(2) %...

5 years ago | 0

Answered
How to produce a plot on the x and y axes
w=8500; teta = 39.29:51.57; F=-w./(2*sin(teta)); % <-- element by element operation ...

5 years ago | 0

| accepted

Answered
I have an cropped square image, inside square there is a circle. I know the diameter of circle. I want find the diameter/area of the circle using Monte Carlo Method.
Refer this for a demo. https://in.mathworks.com/matlabcentral/fileexchange/33543-monte-carlo-method

5 years ago | 0

Answered
how to terminate loop when i get desired result
t0 = randperm(100,1) ; % give some value tol = 10^-3 ; % mention the accuracy you want for i = 1:10000 % f...

5 years ago | 0

Answered
how to center the non-empty pixels of a png image in its frame?
I = imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/665090/image.png') ; I1 = rgb2gray(I) ; I2 = imbin...

5 years ago | 1

Load more