Answered
Unrecognized function or variable 'tankvolume'.
It looks like either you are running the function using F5 key or run button. You need to save the function on the name tankvolu...

4 years ago | 1

| accepted

Answered
How can I import a vector of vectors from txt file into a matrix
fid = fopen('data.txt') ; % your data file S = textscan(fid,'[%f,%f,%f,[%f,%f,%f,%f,%f,%f,%f,%f,%f,%f]]'); fclose(fid) ; S...

4 years ago | 0

Answered
how to loop ?
% Demo example thesum = 0 ; for i = 1:10 thesum = thesum + i ; end

4 years ago | 0

Answered
make several matrices in a for loop ERROR
You have to initialize k as a cell. element = [ 1 2 1 2 3 1 3 4 1] ; E = 2040000 ; lon...

4 years ago | 0

Answered
Can someone write a script for this problem?
To request the input, use function input. Read about it. To calculate the distance you need to use Euclidean distance formula....

4 years ago | 0

Answered
How to plot symbolic function with string specification?
May be you can consider using like below. syms x ; f = x ; h = fplot(f) ; h.LineWidth = 2 ;

4 years ago | 1

Answered
Find an outline to the valued data in a matrix of zeros and values
REad about bwlabel. I = [0 2 2 0 0 0 0 0 2 1 2 0 0 2 1 1 2 0 0 0 2 1 2 0]; L = bwlabel(I)

4 years ago | 0

| accepted

Answered
Unable to loop through the datastore
for k=1:5 k I=readimage(ds.Files{k}) imshow(I) end

4 years ago | 0

Answered
How to save results from each iteration of for loop into one column of an excel
D= readtable('A.xlsx'); T = cell(height(D),1) ; for i = 1:height(D) biopsy_folder = char(D.Path(i)); Step2_folder...

4 years ago | 0

Answered
How do I retrieve the maximum value from a column for each category in another column, and the corresponding values from other columns?
REad about max and min. This will give you value as well as index, with the index you can extract the other values.

4 years ago | 0

Answered
Vectorization of indexing of each row of a matrix by a corresponding row of another matrix?
I_range = 10; % index range for the 2nd dimension of M l = 5; % 1st dimension for I and M w = 4; % 2nd dimension for A, and ...

4 years ago | 1

| accepted

Answered
how can find roots of equation ax^4+bx^3+cx^2+dx+e=0?
REad about roots. https://in.mathworks.com/help/matlab/ref/roots.html

4 years ago | 1

Answered
How to copy file with index start from 079
MAy be you are looking for: for k=79:89 file=sprintf('frameTest%03d.mat',k) ; copyfile('frameTest078.mat',file); e...

4 years ago | 0

Answered
Plotting a %of time vs %of area graph
I did nothing but removed the loop and tried to make code clearer. threshold = 150; %limite maximo de ruido [m,n,p] = s...

4 years ago | 0

Answered
Finding row and column number of values in an image matrix
If your image is a RGB image, the number of column will be product of second and third dimension if you just use size function. ...

4 years ago | 0

Answered
how can i do a multiplication between a column and a row?
A = [2 3 4] ; B = [-2 1 3] ; C1 = A*B' % If you are expecting a dot product betwee them C2 = A.*B % element by element mu...

4 years ago | 1

| accepted

Answered
Index in position 1 is invalid. Array indices must be positive integers or logical values. getting this error command while running this code
This error is simple, you are trying to extract more number of elements than present in the array. A = rand ; % A is aconstat...

4 years ago | 0

Answered
How to identify each points(x,y) on a scatter plot using gscatter (x, y, g)?
REad about text. x = rand(10,1) ; y = rand(10,1) ; g = randi(3,10,1) ; plot(x,y,'.') text(x,y,num2str(g))

4 years ago | 0

| accepted

Answered
Delete points from a graph
idx = C~=0 ; plot(t(idx),C(idx)); grid on;

4 years ago | 1

| accepted

Answered
Solving a set of equations and inequalities
X is a structure. You can access the fields using: Kpx = X.Spx ; Kix = X.Kix ; Also read about double and vpasolve.

4 years ago | 0

Answered
Index exceeds the number of array elements. Index must not exceed 1.
You are expecting fs2 to be of size 1*2. You have take k = 1,2 but your fs2 has only one value. Either take k = 1 alone or defin...

4 years ago | 1

| accepted

Answered
How to save tables in txt or xls file?
Read about writetable.

4 years ago | 0

Answered
How can I can get complete streamlines?
You increase the value of n. n=200; % change this starting_x = zeros(1,n); % starting points for streamlines starting_z = ...

4 years ago | 0

Answered
Tetrahedron mesh from point cloud
Read bout convhull. https://in.mathworks.com/matlabcentral/answers/1635520-convert-convexhull-to-stl-file?s_tid=srchtitle

4 years ago | 0

Answered
Loop to generate Histogram
You can achieved the same without using loop. n = 100 ; a_x = (-2.5 + (2.5+2.5)*rand(n,1)); a = 5*1e-9; b = 0; a_z = a.*...

4 years ago | 0

| accepted

Answered
How to deal with Index exceeds the number of array elements ?
Your start_location is of size 1x9. Where as end_location is only 1x8. You need to put one more index in the variable end_locati...

4 years ago | 0

Answered
How to convert all array values into negative ones?
A = [2; 3; 5; -8; 9; 1; -1] ; A(A>0) = -A(A>0)

4 years ago | 0

| accepted

Answered
matrix addition and substraction
@pramod kumar What ou ask is a very basic question. I would suggest you to take a basic introductory course in MATLAB. https:/...

4 years ago | 0

Answered
How to access the 3rd element in a for loop?
investment = zeros(13,1); investment(1) = 1000; interestRate = 0.01; months =[1:12]; for month = months investment(mont...

4 years ago | 0

Answered
Why the seed number of rng cause different results of accuracy in neural network?
rng sets the seed of the random numbers. When you gace same seed to rng, the random numbers will always be same. for i = 1:10 ...

4 years ago | 0

Load more