Answered
obtain a sequence from a matrix
Please post matlab code in addition to a picture so we don't have to type your matrix ourselves. M = [1 2 3 4 5 6 7 8 9 10 ...

10 years ago | 1

| accepted

Answered
How to filter and regroup data in tables (unstack function)?
Possibly, this will do what you want, assuming you want empty elements for the shorter columns: t = array2table([400 2;411 ...

10 years ago | 0

| accepted

Answered
Adding parts of matrix to another matrix
X = [1 2 3 4 5]; Z = [6 7 8 9 10; 11 12 13 14 15]; [Z; triu(repmat(X.', 1, numel(X)))]

10 years ago | 0

| accepted

Answered
Create a growing array
Since you want to store both strings and numbers you have to use a cell array (or a <http://www.mathworks.com/help/matlab/matlab...

10 years ago | 1

Answered
How to do this
Have you tried using a loop? It would be very straightforward. Alternatively: e=[5,4,45,63,22,22,1,12,3,2,2,16,14,14,16,...

10 years ago | 0

Answered
I have rgb image,the rgb image is splitted into 3 different planes and for every plane I have taken single dimensional array values.Now i want to make pixel values less then 20 as zero and all other values need to be retained as it is.
I have no idea why you posted all these lines of code. I'm afraid to say that most of it, particularly the body of the |for| loo...

10 years ago | 0

Answered
Creation of matrix using lower triangular matrix?
I don't understand what is going in with |A| but the |S| as described is: S = cumsum(hypot(B(1:2:end), B(2:2:end)))

10 years ago | 0

Answered
Subscript indices must either be real positive integers or logicals only in the loop
When reporting an error always report the whole error message including the line at which it occurs. A guess is that one of y...

10 years ago | 1

| accepted

Answered
Change digits in strings
You need to use a dynamic replacement string str = '"A[12,12]*A[12,12]+A[9,12]*A[12,9]+A[5,2]*A[1,3]"'; regexprep(str, '...

10 years ago | 0

| accepted

Answered
Cell ConvertTypes - size inputs must be scalar????
_"Why does cell ConvertTypes not work for this?"_ The question is rather why do you expect it to work? Nowhere does it say in...

10 years ago | 0

Answered
Standard Deviation Between images
Store your images in a 3D matrix and calculate all your stats in one go using |mean|, |std|, etc. on the 3rd dimensions: nu...

10 years ago | 0

| accepted

Answered
how to find all possible paths in MxM matrix
I would actually start from right to left. For each row build the list of the two or three rows you can reach. Add the list of r...

10 years ago | 0

Answered
How do I get rid of the K>> prompt?
You've got a K>> prompt because you've entered debug mode within a function, either because you put a breakpoint there yourself,...

10 years ago | 5

Answered
How do i find the index from a logical array that meets the condition, without using for loop?
This is a classic run length encoding problem, there are several functions that calculate that for you on the <http://uk.mathwor...

10 years ago | 0

Answered
I have got a problem in my script file in defining a function. When I run the program it says 'Index exceeds matrix dimensions'. How can I solve this error?
_How can I solve 'Index exceeds matrix dimensions'?_ Easy, don't use an index bigger than the size of the matrix! Most likely...

10 years ago | 0

Answered
divide a vector in subvectors
You can split your vector into a cell array of subvectors using <http://www.mathworks.com/help/releases/R2015b/matlab/ref/mat2ce...

10 years ago | 0

Answered
I want to create a matrix where each column is obtained by subtracting 1 from the previous column.
Use a loop, |repmat| or |bsxfun|. e.g: startcolumn = [4; 3; 1]; numcolumns = 5; A = bsxfun(@minus, startcolumn, 0:num...

10 years ago | 0

| accepted

Answered
how to make 'for' loops to represent rows and columns
You get _"error using fscanf.Invalid file identifier"_ because the |fid| in the |fscanf| call is invalid. The |fid| is invalid b...

10 years ago | 1

| accepted

Answered
check dimensions for parameters
The answer is to change the way you work and rewrite your script as a function. Instead of dumping your dataset into the base wo...

10 years ago | 1

Answered
How to load text file (given in image) in square matrix form, please help me any body as i m new in this field.
Assuming you mean rectangular and not square, this would do it: filecontent = fileread(data_file.rdf); %read file as one co...

10 years ago | 0

Answered
store data from matrix rowwise in indexed structure
To create your matrix in the first place you went through two steps: # Created a comma separated list out of your structure (...

10 years ago | 1

| accepted

Answered
Extract certain rows from matrix
To test if members of a set belong to another set you use <http://www.mathworks.com/help/matlab/ref/ismember.html |ismember|>, w...

10 years ago | 0

Answered
What is the wrong with the following code?
|xmlread| does not read urls, only files. To read urls you can use <http://www.mathworks.com/help/matlab/ref/webread.html |webre...

10 years ago | 0

| accepted

Answered
Change a 3D matrix to a stacked 2D matrix
Your |permute| does not make much sense and implies that there are 14680 dimensions instead of three. Since all the dimensions a...

10 years ago | 4

Answered
how to cluster bit strings using matlab
It sounds like you just want to identify all identical _'bit strings'_ and assign them the same ID. This can easily be achieved ...

10 years ago | 0

| accepted

Answered
Using a while loop on each column in an array?
I'm not entirely clear on everything particularly on the stop condition for your loop. You can indeed calculate the result a...

10 years ago | 0

Answered
Select season from monthly series
Assuming that you mean that the values of the third column go from 0 to 756, that is it is the number of months elapsed since Ja...

10 years ago | 0

| accepted

Answered
Creating table: how to define variable names
The way to _circumvent this problem_ is to use the proper function to create a table from a matrix which is <http://www.mathwork...

10 years ago | 1

Answered
Speed up code to compare fields in a struct
First, a piece of advice. Writing code that works and is efficient is only half the battle. Writing code that can be understood ...

10 years ago | 1

| accepted

Answered
I don't know why am getting this error: Undefined function 'fetch' for input arguments of type 'struct'.
I think the problem is that you've not fully understood what you are doing. Where does the |curs| variable come from in your exa...

10 years ago | 0

Load more