Answered
Add two rows in a matrix with new datas
E = pascal(10) ; iwant = [E ; mean(E) ; std(E)]

5 years ago | 0

Answered
i can't plot this function in matlab
You see, your f is not a complex number. As you are plotting it as complex, you are getting a striaght line. t=-1:0.01:1; a...

5 years ago | 0

Answered
looping through columns of a matrix and saving output
This kind of error occurs when you are trying to save more number of elements than it is intiliazed. Example: A = zeros(1,3) ...

5 years ago | 0

Answered
Compare two vectors in matlab n*m
A=[1 2 3 4 5 6 7 8 9 10] ; B=4 ; idx = A >= B

5 years ago | 0

Answered
making functionality by experiment results
Read about regression. https://in.mathworks.com/help/stats/mvregress.html

5 years ago | 0

Answered
find the x value
I will show one for you, rest you should follow the same. % y=10 sqrt(x) + 20 x >= 8 x = linspace(8,100) ; y =...

5 years ago | 1

Answered
Approximate dots area by circle and define its radius
Find the mean of the points, C. This will be center of circle. Find the distance between C and each point. Get the maximum of...

5 years ago | 1

| accepted

Answered
How to check for file existence in previous folder
exist('../filename')

5 years ago | 0

| accepted

Answered
how to read a value in matlab from an xls file
T = readtable('whatever.xls')

5 years ago | 0

| accepted

Answered
How to find the 2-D correlation coefficient between the two images, each having same pixels?
Read about ssim. You can try: R = regression(Img1(:),Img2(:)) ;

5 years ago | 0

Answered
Finite Element Analysis in Matlab
It is not an error, it is a warning. You need to initialize the variables which you are using in loop. Replace the lines: for...

5 years ago | 1

Answered
help with regression fitting - curvilinear
load('data.mat') p = polyfit(data(:,2), data(:,1), 2); xi = linspace(min(data(:,1)),max(data(:,2)),1000) ; yi = polyval(p, ...

5 years ago | 0

| accepted

Answered
Can't work out what I did wrong
Replace the line rror_f=(f(x)-g(x)/g(x)) ; with rror_f=(f-g./g) ; f and g are already evaluated with the given values of x....

5 years ago | 0

Answered
How to create grid coordinates using elements of two matrices
A = [2 3 ; 4 5] ; B = [6 7 ; 8 9] ; for i = 1:2 for j = 1:2 P = [A(i,j) B(i,j)] end end

5 years ago | 0

| accepted

Answered
Hello I would like to find two values of x similar/close to 0.71 for the same value of y as shown in the image file.
x = (1:length(y))' ; idx = knnsearch(y,0.7,'k',2) ; plot(x,y,'r') hold on plot(x(idx),y(idx),'*k')

5 years ago | 1

| accepted

Answered
Eigenvalue and Eigenvector extracting
t = 0:0.5:10 ; A = @(t) [t^2/2 (1+t)/2 t^2 ; 3 0 t^3-1 ; 4 0 0] ; nt = length(t) ; V = zeros(3,3,nt) ; D = zeros(3,...

5 years ago | 0

| accepted

Answered
how to find peaks for 100%,75%,50%,25% of the max peak
T = readtable('VINCENT NORMALISED MC.txt') ; x= T.(1) ; y = T.(2) ; % find max [val,idx] = max(y) ; % find 75, 50 and 25...

5 years ago | 1

Answered
How can I plot 5 different variable all together?
You can use plot, you will get 5 different curves and you can put legend for each. Or you can plot them as surface using surf....

5 years ago | 0

| accepted

Answered
I am finding error while writting code of tridiagonal matrix as my matlab do not konw what is tridiagonal
Do not run th function as code i.e. you are running the code with f5 or using the run button. You need to give inputs to the fun...

5 years ago | 0

Answered
Creating 2D Matrix from latitude/longitude values
Let (x,y,r) be your lon,lat, radar reflectivity values in column. xi = -92.5:0.02:-87.5 ; yi = 27.2:0.02:32 ; [X,Y] = mesh...

5 years ago | 0

Answered
Turning for outputs into a row vector
a = -2:2 ; for i = 1:length(a) b(i)=a(i).^2 end No Loop needed: a = -2:2 ; b = a.^2 ;

5 years ago | 1

| accepted

Answered
To make a function of n variables using a vector of length n
V = [10 20 30 40] ; x = rand(1,4) ; f = x*V' ;

5 years ago | 0

Answered
Plotting of the function 𝑥(𝑡) = 𝑒^(𝜆*𝑡) for λ = −1, −2, −3, −4 and 0 ≤ t < 10
DEfine lambda values. DEfine t values. Write the formula. Substitue lambda, t in the equation. Use plot. Example: t = l...

5 years ago | 0

Answered
How to obtain and locate group of pixel value from .mat file
Read about logical indexing. Let C be your data. idx = C >= 0 & C < 2 ; c02 = C(idx) ; idx = C >= 2 & C < 4 ; c24 = C(id...

5 years ago | 0

| accepted

Answered
How to Plot the parametric space curve of matlab
x = linspace(-5,5) ; y = linspace(-5,5) ; [X,Y] = meshgrid(x,y) ; Z=-7./(X.^2+Y.^2+1) ; surf(X,Y,Z)

5 years ago | 1

| accepted

Answered
Problem in using interp2
Vq = interp2(X,Y,V,Xq,Yq) ; In the above V is the value at (X,Y). You need to have that value.It seems you have only Lon and L...

5 years ago | 0

Answered
using datetime() in retrieving data
Read about datevec. This will split your date into year, month, day, hour, minute and secobd. From here you can use logial index...

5 years ago | 0

Answered
Extract a profile from 3D data
If data is structured: x = X(1,:) ; y = Y(1,:) ; % give your required row value depending on y-value z = interp2(X,Y,Z,x,y)...

5 years ago | 0

| accepted

Answered
Writing a math equation.
x = linspace(0,pi) ; f = sin(1+x) ; plot(x,f)

5 years ago | 0

Load more