Answered
Error using solve: Unable to perform assignment because the left and right sides have a different number of elements.
The above error occurs when you try to save more number of elements in a position then it is initalized. Use cell array as shown...

5 years ago | 0

| accepted

Answered
Plotting the trend line without plotting the data
REad about hold on. After plotting the first, use hold on. Alkso you may go ahead like below: p = polyfit(wspd_3yr,msid_3yr,1...

5 years ago | 1

| accepted

Answered
how to apply band pass filter on .csv data
Load the data. For this use csvread, readtable. Apply the filter.

5 years ago | 0

Answered
ERROR: Index in position 1 is invalid. Array indices must be positive integers or logical values.
The error is not due to 10e-09. In the present, you have not shown us the complete code, so we cannot help you exactly. But this...

5 years ago | 1

Answered
How to get multiple slopes from a file.
You have to run a loop for each column for which you want to get slopes. data = csvread("test.csv"); [m,n] = size(data) ; s...

5 years ago | 0

| accepted

Answered
Unable to perform assignment because the left and right sides have a different number of elements
This error happens when you try to save more number of elements than initialized. Example: A = zeros(1,3) ; A(1) = rand(1,2...

5 years ago | 0

Answered
Permute doesn't work as expected
temp = zeros(3,4,7); size(temp) % temp = permute(temp,[3,1,2]); temp = permute(temp,[2,3,1]); size(temp) % 4 x 7 x 3

5 years ago | 0

Answered
Plotting of a quadratic equation ant its differentials using specifiers
It is your home work and a simple problem; you have to try on your own. Follow the steps. Define minimum x and maximum x i.e. ...

5 years ago | 0

Answered
How to make a surface plot given an NxMxK matrix?
Let A be your 100*2*10 data matrix. [m,n,p] = size(A) ; for i = 1:p x = A(:,1,i) ; y = A(:,2,i) ; nx = length(uni...

5 years ago | 0

Answered
Plot associate two numbers
P = [0.04 70 ; 0.06 146 ; 0.05 161 ; 0.07 193 ; 0.08 197] ; plot(P(:,1),P(:,2))

5 years ago | 0

| accepted

Answered
How to make united polygons from separated polygons?
Let P1,P2,P3 be your three polygons data which I am assuming as column dominant. P = [P1; P2; P3] ; % merge the data idx = bo...

5 years ago | 0

| accepted

Answered
How can I plot a matrix of data over a period of time?
t = 1:1:60 ; % time nt = length(time) ; Am = zeros(100,nt) ; Bm = zeros(100,nt) ; for i = 1:t % run your functions h...

5 years ago | 1

| accepted

Answered
finding a word after a certain word in a text
Read about strfind. Also have a look on contains.

5 years ago | 0

Answered
Print out each matrix element
You need to read about fprintf. formula = 3 ; A = rand(3) ; [m,n] = size(A) ; for i = 1:m for j = 1:n ele = A...

5 years ago | 0

| accepted

Answered
Searching through files for missing data
You may follow something like this: files = dir('*txt') ; % give your extension % Create a datetime vector for the files pr...

5 years ago | 0

| accepted

Answered
Find a string cell into a variable of a table
Read about ismember. idx = ismember(B(:,1),A(1,1)) ; % this will give indices where the elements match Also have a look on...

5 years ago | 1

Answered
Sine and Cosine plot
It is your Home work which is really simple. And you should do it. Here are the hints. Define intial value x0 = -2*pi ; Defin...

5 years ago | 1

| accepted

Answered
How to put a range of values into an array
Read aboout linspace. xo = 1 ; x1 = 10 ; x1 = linspace(x0,x1,500) ; % creates 500 points between 1 and 10 dx = 0.1 ; x2 ...

5 years ago | 0

Answered
For loop indexing of variable
N=10; M2 = zeros(N,1) ; Mp=1; for i=1 : N M2(i) = Mp; Mp=Mp+1; end

5 years ago | 1

| accepted

Answered
Data structure that handles variable size data elements.
You can make them a cell.... Read about cell. C{1} = single(pi) ; C{2} = double(pi) ;

5 years ago | 0

| accepted

Answered
how to change the interior pixel of a closed boundary surface to a different pixel using MATLAB?
Yopu can exclude the boundaries by indexing right? A = interior_filled(2:end-2,2:end-2) ; Now you apply the given values as ...

5 years ago | 1

Answered
Read Variables with assigned values from excel into Matlab
file = 'test.xlsx' ; T = readtable(file) ; vars = T.(2) ; vars(isnan(vars))=[] ; vars

5 years ago | 1

Answered
Unable to perform assignment because the left and right sides have a different number of elements.
function myfunc() %euler exlicit method h = 0.1; x = 1:h:10; y = [0 -1]; for i = 1:length(x) x(i+1)=h+x(i); y(i+1...

5 years ago | 0

| accepted

Answered
Fix: Index in position 2 is invalid. Array indices must be positive integers or logical values. ??
This line: x(j,i) = x(j, i-1) + delta; In the above the value of j-1 will be zero when j = 1. This case, the index will be ze...

5 years ago | 0

| accepted

Answered
problem plotting 2d FDM wave equation simulation
Read about surf / plot. [nx,ny,nz] = size(u) ; for i = 1:t pcolor(X,Y,u(:,:,i)) ; drawnow end

5 years ago | 0

Answered
array indices must be positive intergers or logical values - not sure why i am getting this error message. same code worked for a friend of mine.
Read about clear. When you feel you are done with your previous code, then you can clear all your workspace variables and then r...

5 years ago | 1

| accepted

Answered
Random sampling and removing data
You can make the data random by using the below and then you can pick the points. points = [10 10 0; 10 13 0; 10 16 0;20 10.1 ...

5 years ago | 0

| accepted

Answered
geographic coordinates and speed
It depends on whether your data is scattered data or structured data. What ever it is, what you want is very much possible. Refe...

5 years ago | 1

| accepted

Answered
How can I delete rows by their name in a TABLE
idx = strcmp(a.Type,'EQU') ; % gt the indices which has EQU T(idx,:) = [] ; % remove the rows

5 years ago | 1

| accepted

Answered
Find intersecting points in a image
I = imread('myimage') ; % give your image [y,x] = find(I==0) ; % white pixel value; idx = boundary(x,y) ; bnd = [x(id...

5 years ago | 0

Load more