Answered
How to make a for faster?
idx_=1:18:length(iy) ; idx=1:18:length(ix) ; if min(idx)==1 altura_raio_direto = heights(idx) ; end altura_raio_direto ...

6 years ago | 0

Answered
Select values from meshgrid that fit a constraint.
[x,y] = meshgrid(-10:0.1:10); d = x.^2+y.^2 ; idx = abs(d-1)<=10^-3 ; iwant = [x(idx) y(idx)] plot(x,y,x',y') ; hold ...

6 years ago | 1

| accepted

Answered
Index exceeds the number of array elements (9).
The error is simple. You are trying to extract more than the number of elements present in the array. A = rand(5,1) ; A(1) ...

6 years ago | 0

Answered
Save For loop results to vector/matrix
%initailze the derivative of u, u_prime, and the step size, dx u_prime=@(x)(x^2+4); % dx = input('What is the step size? '); ...

6 years ago | 0

Answered
How to enlarge an image using spline interpolation
I = imread("image.jpeg") ; % assuming image to m*n [m,n,p] = size(I) ; x = 1:n ; y = 1:m ; % Inteprolate to double xi = ...

6 years ago | 0

| accepted

Answered
Plot marker on points not specified within the vector
You need to do interpolation frst to get 75% of maximum value. x = 0:1:11; y = [0 1 2 3 4 5 4 3 2 1.5 1 0]; % y75 = 0.75*ma...

6 years ago | 0

Answered
markers not getting joined in plot
plot(x,y,'o',x,y,'-') Or plot(x,y,'-o') Or plot(x,y,'o') hold on plot(x,y)

6 years ago | 0

Answered
Q2. electric potential
This is an Home work problem..I will show you an demo example..you need to extend this to your case. m = 100 ; n = 100 ; x ...

6 years ago | 2

Answered
add count of elements on a for loop to count values greater than and less than
A = rand(1,10) ; N = nnz(A<0.5 | A>0.8)

6 years ago | 0

Answered
read multiple excel files with different file names ?
xlFiles = dir("*.xlsx") ; N = length(xlFiles) ; for i = 1:N thisFile = xlFiles(i).name ; T = readtable(thisFile) ;...

6 years ago | 0

Answered
Separate Cell Into Multiple Rows
[txt,num,raw] = xlsread(file) ; num Or T = readtable(file) ; T.1

6 years ago | 0

Answered
Plot graphs in Matlab using script file
You need to read about linspace plot Define t using linspace and the limits given. DEfine g Write your formula. Use pl...

6 years ago | 0

Answered
How to plot a simulation result overlaid on an experimental image?
You can use image and proved the x-axes and y-axes limits as in your plot use hold on and plot the data. Now the (x,y) data of b...

6 years ago | 0

Answered
Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 0-by-0.
Try: count = 0 ; A = zeros([],1) ; for i=1:64 %read 64 lines of data temp = fscanf(Arduino,'%f') ; if ~isempty...

6 years ago | 0

| accepted

Answered
coneptually question: How to extract certain rows if column conditions are met?
Let T be the table you have. idx = T.Pets==1 ; T(idx,:)

6 years ago | 0

| accepted

Answered
How to plot the average plot out of three plots
You should decide the x-axis same for all the data and make y-values NaN for out of odmain/ extrapolation range and use mean/ na...

6 years ago | 0

| accepted

Answered
HOW TO RUN THROUGH A COLUMN ON EACH RUN?
Your code should be somthing like this: P = [-114.6669754, 12.1182018, -42.40572234 -109.6669754, 12.1182018, -42.4057...

6 years ago | 0

Answered
How to convert mxmxn single into STL?
You can get X, Y as below: I = rand(288,288,290) ; [m,n,p] = size(I) ; [X,Y,Z] = ndgrid(1:m,1:n,1:p) ; Z = I ; p = [X(:...

6 years ago | 0

Answered
Change length of double data
Read about interp1. a = rand(803385,1) ; N = length(a) ; x = (1:N)' ; % xi = linspace(1,N,7547)' ; ai = interp1(x,a,x...

6 years ago | 0

| accepted

Answered
How to plot meshgrid without successive intervals
X=[1,1.5,2,2.5,3] ; Y=[0.8351,0.8265,0.7569,0.6348,0.5219] ; [X,Y] = meshgrid(X,Y) ; plot(X,Y,'r',X',Y','r')

6 years ago | 0

Answered
How do I create an array of one column and several lines with only a few characters from the name of my files?
name = "03000_20200506_0300.dat"; s = strsplit(name,'_') ; s{1} Or name = "03000_20200506_0300.dat"; name(1:5)

6 years ago | 0

| accepted

Answered
Rectangular mesh using coordinates
B =5; x1 = linspace(0,5/10,10); y1 = linspace((B-B/12),B,10); [X,Y] = meshgrid(x1,y1); plot(X,Y,'r',X',Y','r') Also read ab...

6 years ago | 1

| accepted

Answered
How to designate color in contour plot with specific values
[c,h] = contour() c has all the points and h has all the repsective levels. Pick your required level and use plot with the colo...

6 years ago | 0

Answered
How to analyze the data from a graph saved as a .png image?
Try this file form file exchange: https://www.mathworks.com/matlabcentral/fileexchange/7173-grabit Note that it is a tedious jo...

6 years ago | 0

Answered
I have an "unrecognizable function or variable" error and it says it is because of "Cubeside_cm" please help!
There is a typo error. Replace Cubside_cm with Cubeside_cm

6 years ago | 0

Answered
Issue with 'for' loop - trying to iterate through and change certain values to 0 in array
Loop is not required. Get the logical indices and do it. Let A be your array. tol = 10^-5 ; val = 0.3095 ; idx = abs(A-val...

6 years ago | 0

| accepted

Answered
Solve numerical equation with Y at both sides
You can use symbolic package. Something like this: syms Y_0 Y B x Y D alpha eqn = Y/Y_0 - B * (1 + x*Y/D)^0.5 * (1-x)^alpha==0...

6 years ago | 1

Answered
Plot a elliptic cone
I can plot a ellipse like this: x = linspace(-2,2) ; y = linspace(-2,2) ; m = 100 ; n = 100 ; theta = linspace(0,2*pi,...

6 years ago | 0

Answered
std error (missing value)
What error you got exactly? Is your data a matrix? If so how it can have missing values? Missing values will be replaced by NaN'...

6 years ago | 0

Answered
Removing repeated numbers in a matrix
A = [9 9 1 1 2 2 2 2 2 0 3 3; 7 7 4 4 4 5 5 6 6 6 6 6 ; 8 8 7 7 7 8 8 8 9 9 9 5] ; [m,n] = size(A) ; C = cell(m,1) ; for i ...

6 years ago | 1

Load more