Answered
How to solve this error?
The error is clear. It seems you have an array of size 1x17 and you are trying to extract elements more than present in it. % ...

4 years ago | 0

| accepted

Answered
Vectors must be the same length
p1=plot (Distanz(i,:) , [Z(i,:) ; HQextrem(i,:); HQ5000(i,:); HQ10000(i,:)]);

4 years ago | 0

| accepted

Answered
How can i automatically Fill Legend using Cluster Number (K-means)
%Read Dataset %Find the Optimal Clusters for this dataset eva = evalclusters(dataset,'kmeans','silhouette','KList',[1:10]) K=...

4 years ago | 0

Answered
how to make figure that shown below
load('aaaa.mat') ; time = aaaa(:,1) ; ttt=(time/60); % Set the time in minutes for figures % Rescale the time to look ...

4 years ago | 0

| accepted

Answered
How do I print a given martix in a spiral matrix scan order but the start from any element as user defined?
This might help you: https://in.mathworks.com/matlabcentral/answers/466188-how-do-i-generate-a-spiral-matrix-which-starts-from-...

4 years ago | 0

Answered
'equal' operator does not work on tables
You need not to un a loop. You can get it with one go using ==. Let T1, T2 be your tables, and you want to comapare 9 the column...

4 years ago | 0

Answered
Extract 2D matrix from 3D matrix
Read about slice

4 years ago | 0

Answered
Asking the user to enter the extension of the files and load all of them in the current directory
files = dir('*.txt') ; filenames = {files.name}

4 years ago | 0

Answered
Maths Solution to a equation
syms n eqn = cos(0.8)^n == sqrt(2) ; s = solve(eqn,n) vpa(s)

4 years ago | 0

| accepted

Answered
ODE45 needs column vector from anonymous function
options = odeset('RelTol',1e-4,'AbsTol',1e-2); yprime = @(x,y) ((-x.*y)/(sqrt(6-(y.^2)))); Y = [0.5 1.0 1.5 2.0]; tspan = [...

4 years ago | 0

Answered
I want to store multiple entries in one location in matrix
You can save them into a cell array. Read about cell. % Dummy data demo A = cell(2,3) ; for i = 1:2 for j = 1:3 ...

4 years ago | 0

Answered
I want to create a 2D scatter plot with loops
[X,Y] = meshgrid(0:40,0:50) ; scatter(X(:),Y(:),[],Y(:)) scatter(X(:),Y(:),[],X(:))

4 years ago | 0

Answered
How to get only random samples which are in allowed range and reject the rest?
idx = [0 0 0] ; while nnz(idx)~=3 u = rand(3,1)-0.5; y = - 10 * sign(u).* log(1- 2* abs(u)); idx = y ...

4 years ago | 0

| accepted

Answered
Adding every loop a matrix from the right side to a matrix
A = [1,2;3,4] ; B = repmat(A,1,2)

4 years ago | 0

| accepted

Answered
Accessing data within a structure
iwant = angles.LkneeAngles

4 years ago | 1

| accepted

Answered
An error in my code
syms x f = atan(x) ; t = taylor(f,x,0,'order',5)

4 years ago | 0

Answered
Strings from Loop to array
Parameter1 = 5 ; Parameter2 = 5 ; Name = cell(Parameter1,Parameter2) ; for i=1:Parameter1 for j=1:Parameter2 ...

4 years ago | 0

| accepted

Answered
How to crop the ROI of a set of dicom images?
Read about imcrop, imcrop3. You can achieve it by providing the vertices of ROI.

4 years ago | 0

| accepted

Answered
How to extract consecutive numbers from array of integer numbers?
Read about reshape load('array.mat') orbit = reshape(array,[],length(array)/200) ;

4 years ago | 1

| accepted

Answered
How can I zoom into my plot function to a -4 to 4 "interval".
v1 = [1 -2 -5 6]; v2 = [-100 : .1 : 100]; y = polyval (v1, v2); plot (v2, y) xlim([-4 +4])

4 years ago | 0

Answered
Solving a polynomial function using the solve function is not working
Read about roots p = [1 -2 -5 6] ; r = roots(p)

4 years ago | 0

Answered
Mapping toolbox: irregular measured geo referenced data into regular grid
You can interpolate the data into a regular grid. Read about interp2

4 years ago | 0

Answered
Problem with adjusting axis limits in surface plot
Use zlim as well. zlim([-3 3])

4 years ago | 0

| accepted

Answered
how to differentiate this function
syms ph(t,z,zr,r,r0,f) a(r,f,r0,ph) ph = t-z+2*tan(z/zr)-(z/zr)*(r/r0*f)^2; a = r*exp(-r^2/r0^2*f^2)*cos(ph); dphdr = dif...

4 years ago | 0

Answered
How do I add columns of data to an array in a for loop?
In the line where it throws error, you are trying to save a 6x1 array into a single element 1x1; which you cannot. Check the bel...

4 years ago | 0

| accepted

Answered
Coordinates/values around number in array
If (i,j) is the index of number 2; then the nearest elements to it will be (i-1,j),(i+1,j),(i,j+1),(i,j-1),(i+1,j-1),(i+1,j+1),(...

4 years ago | 0

Answered
solve a symbolic system of simultaneous matrix equations
P=[0,1,0;1/3,1/3,1/3;0,1,0]; [V,D]=eig(P); disp([V,D]); A=sym('A', [3 3]); B=sym('B', [3 3]); C=sym('C', [3 3]); I=eye(3);...

4 years ago | 1

| accepted

Answered
Error using vertcat Dimensions of arrays being concatenated are not consistent.
Becareful while leaving space between terms in the array. function [time,state_values]= mathematical %%Initial value...

4 years ago | 0

Answered
what is the problem in my code to find te value of the derivative of f at the given point x=sqrt(1/2)
You should replace f with: f = @(x) asind(x) ; % anonymous function Presently now you are accessing it with the values, which...

4 years ago | 0

| accepted

Answered
How to find indices where there is a minimum?
A = [1 2 3; 5 8 1; 3 0 1] ; [val,idx] = min(A,[],2) ; iwant = full(ind2vec(idx'))

4 years ago | 0

Load more