Answered
How to change background color of a surf
pcolor(x,y,z) axis off % box on % shading interp % colorbar

6 years ago | 0

Answered
How to compare values within a matrix?
In case are you looking for this? idx = find(accuracy < 0.05)

6 years ago | 0

Answered
Calculating the distance/error between two graphs when the coordinates are given. Coordinates are not of equal size
You can get A to the size of B using interpolation vice versa. Read about it. % Get A to the size of B using interpolation [...

6 years ago | 0

| accepted

Answered
how to make intersection?
Read about knnsearch. With this you can pick the nearest point to the given point. Or you can use this file exchange: https://...

6 years ago | 0

Answered
function for sum of each two next values
Let V and p be your arrays of velcoity and power. k = 2; A = 9; f = exp(-(v(1:end-1)/A).^k) - exp(-(v(2:end)/A).^k); H ...

6 years ago | 0

| accepted

Answered
Why my data is not plotting the graph using plot(Q,h)
q = [0:1:100]; h = zeros(size(q)) ; for Q = 1:length(q) if val < h1 % < --- think of this line v_2 = ((Q/1...

6 years ago | 1

| accepted

Answered
Fig file extraction of data and legend from plots
If your extracted data is a matrix.....the order of legend should be order of rows.

6 years ago | 0

Answered
what means this?
iter,eps: iter is number of iterations. eps stand for a small value. So your code runs either for 10 iterations or till the erro...

6 years ago | 0

| accepted

Answered
How to extract specific data from the data files?
iwant = interp1(CL,CD,0.6) This is the procedure: CL = [ 0.572526 0.601916 0.631107 ]; CD = [ 0.024868 0.025337 0.02590...

6 years ago | 0

| accepted

Answered
Fill area inside 4 connected lines in a plot
Read about padzeros, padarrays. A = ones(5,4) ; iwant = zeros(8) ; iwant(3:7,3:6) = A ;

6 years ago | 0

| accepted

Answered
Do not take any amount
pop=randi([100],20,8); [r1,c1]=size(pop); pool = zeros([],c1) ; count = 0 ; for i=1:r1 A=randi(100); if A<=90 ...

6 years ago | 1

| accepted

Answered
Problem using imagesc plot for non uniform values
data = importdata("data_analysis.txt") ; x = data(:,1) ; y = data(:,2) ; z1 = data(:,3) ; z2 = data(:,4) ; % Use int...

6 years ago | 0

| accepted

Answered
Drawing a Best Line Fit for some Points
Read about polyfit. p = polyfit(x,y,1) ; yi = polyval(p,x) ; plot(x,y,'.r') hold on plot(x,yi,'b')

6 years ago | 0

Answered
How to include text in a running figure
You can use text/ title with sprintf. for t = 1:100 plot(rand(1,10)) ; title(sprintf("time step = %s",num2str(t))) ; ...

6 years ago | 0

Answered
How can i take ds/dx and ds/dy of a function numerically
ds/dx=-3*x^2+3*y^2 ds/dy = 6*x*y

6 years ago | 0

Answered
Plot variables (total could cover) from Netcdf file
Your tcdc is a 3D matrix. You can plot only one 2D matrix using pcolor. Follow the below: pcolor(longitude,latitude,tcdc(:,:,1)...

6 years ago | 0

| accepted

Answered
Counting occurance of exact word from string array
R1 = ["Ar* + Ar* "," Ar+ + Ar + e "]; % chemical reaction (string array; col1=reactants, col2=products) s = "Ar" ; n = nnz(s...

6 years ago | 0

Answered
Comparison of specific values from the same matrix
[val,idx] = min(Z(2:end))

6 years ago | 0

| accepted

Answered
Correlate two sets of data defined on different meshings of the same surface
You can get the respective mesh Z values to a required grid, using interpolation menthods. Read about griddata, scatteredinter...

6 years ago | 0

Answered
MSE and RMSE of a matrix
If yt and ye are the column vectors of theory and experimental values. You can get MSE, RMSE using: e = (ye - yt) % Errors ...

6 years ago | 0

Answered
Error Plot, vectors must be of same length. I can't understand where the error is exactly
Note that your Q is a row vector and not a column vector. You should use Q(1,:), Q(2,:) not Q(:,1), Q(:,2). D = 90.5*0.4814E-3...

6 years ago | 0

Answered
Create a series of vector with different name
s = '161724' v = [s(1:2),':',s(3:4),':',s(5:6)] If array s = ['161724'; '161725'; '161726'] ; k = repelem(":",size(s,1),1...

6 years ago | 0

Answered
Error with variable definition
t = 0:200; VaR = logninv(0.1,3,1) f = t.*logncdf(t,3,1)/0.1; % < ---- element by element operation CVaR = integral(f,-inf,...

6 years ago | 0

Answered
4 matrix generation depending on a specific value,
You can use this File eXchange: https://in.mathworks.com/matlabcentral/fileexchange/69507-npermutek s = [0 1] ; iwant1 = nper...

6 years ago | 0

Answered
Why is fimplicit not plotting x^2 = 0 ??
x = linspace(-5,+5,100) ; y = x.^2 ; plot(x,y)

6 years ago | 0

Answered
use a for loop to create a script that prints numbers 0 through 10, except 3 and 6
for i = 0 : 1 : 10 disp(i) if i == 3 || i == 6 printf("Value = %d\n") end end

6 years ago | 0

| accepted

Answered
Gradient of a 2D plot
M = sqrt(U.^2+W.^2) ; contour(X,Y,M)

6 years ago | 0

Answered
index exceeds array bounds
m = dof(de,4) ; % I hope this is a number ne = length(b) ; % dimensions of b and ckx, cky should be same Ckx = cell(m,ne...

6 years ago | 0

Answered
changing my x increment along fplot
Why syms for this? x = 0:0.002:2 ; y1 = 7*x.^2 -8*x + 1; dy1 = 14*x-8 ; plot(x,dy1)

6 years ago | 1

| accepted

Load more