Answered
remainder while dividing a number by x number of digits
Avoid using |i| as a variable name, it's meaningless and it's also a function in matlab. To answer your question, use vectori...

10 years ago | 1

| accepted

Answered
Sum of array items into another array
If your structure has fields other than the speed fields, you can loop over a hardcoded number of speed fields: numspeed = ...

10 years ago | 1

Answered
Merge cell arrays by row
I don't think there's a way without a loop or |cellfun| / |arrayfun| or |accumarray|. It can still be efficient. If I were to us...

10 years ago | 0

Answered
How to change a certain value color in pcolor
When you call |colormap jet| you assign a colormap to the figure with as many entries as the default colormap, which is probably...

10 years ago | 0

Answered
file contains 1x14 cells. each cell consist of [1x1] cell which in turn consist of data[189x2 doubles]. i have fetch all the datas and keep it in a single cell of 1xn cell. please help me out , how to code this?
We keep saying on this forum not to use |eval|. I assume that you ignored that advice and generated all these matrices with |eva...

10 years ago | 0

| accepted

Answered
How to specify the format of just one column with readtable?
Please ignore Shameer's comment about using |xlsread| instead of |readtable|. They provide exactly the same support of xls file ...

10 years ago | 3

| accepted

Answered
sprintf before fprintf breaks newline
The problem has nothing to do with |sprintf| but with your usage of <http://www.mathworks.com/help/matlab/ref/strcat.html |strca...

10 years ago | 2

| accepted

Answered
How to select specific data from a structure
This is why I think it's not a good idea to recommend using dynamic field names instead of |eval|, it leads to the same problems...

10 years ago | 3

Answered
How to calculate sequencing arrays in a matrix
If I understood correctly, a simple |accumarray| is all you need: ids = unique(A(:, 1)); numdegrees = max(A(:, 2)); o...

10 years ago | 1

| accepted

Answered
How to read alternate rows from an excel sheet?
Yes, as per Shameer's answer, |xlsread| does not support reading non-continuous ranges, so you'll have to read the whole range a...

10 years ago | 1

Answered
how to rearrage a cell array?
I don't really understand, I <http://uk.mathworks.com/matlabcentral/answers/289173-editing-the-cell-array gave you a solution> t...

10 years ago | 2

Answered
How to read date and time from text file and move into cell array?
Before you remove the headers obviously: date = regexp(Cstr{4}, '(?<=Date:\s*)\S+', 'match', 'once'); time = regexp(Cstr...

10 years ago | 2

Answered
can anyone help in getting a matrix of 0's and 1's in which each row contains only one 1 and that 1 is restricted to take some places in each row?
For each row, simply generate a random permutation of the vector |[1, zeros(columncount - numberofexcludedcolumns - 1)| and puts...

10 years ago | 0

Answered
how to ignore a value and jumps to next row for calculation?
Probably the simplest thing, is to store the location of the 999, remove them, perform your averaging (which is then very straig...

10 years ago | 1

| accepted

Answered
Adding drawn greyscale images on top of each other
The grey frame is because your |axes| does not occupy the whole figure, by default matlab leaves some margin around axes. Set...

10 years ago | 0

| accepted

Answered
Datetime from Unix time miliseconds
Both |datetime| and |datestr| support milliseconds just fine. You just need to tell them you want the milliseconds displayed. ...

10 years ago | 2

Answered
Resize 4D image (RGB + another channel)
It depends on what that extra channel represents (and on the resizing method that you want to use). Assuming that extra channel ...

10 years ago | 0

| accepted

Answered
how to blend the mosaic output and composititing it into flat view
_"i need the output without the those black areas and those black pixels should be filled with the image pixels"_ There are ...

10 years ago | 0

Answered
Save a vector from a loop 0:1
obviously, you can't use decimal values as indices, so you would have to use an integer index both to iterate over your |0:0.1:1...

10 years ago | 1

Answered
Increasing number in an array by an order of magnitude
v = 10 .^ (-1:3)

10 years ago | 1

| accepted

Answered
How to set evenly space yAxis?
Ignoring the initial 0, your yaxis is a geometric sequence which will display evenly spaced on a log scale. So use a |loglog|...

10 years ago | 0

Answered
Not able to Call C# Function from MATLAB Script
There is no need to give your .Net class a dual interface, nor is there any need to go through COM to call .Net code from matlab...

10 years ago | 0

Answered
Matlab: organize a great number of data based on month, day and hourly intervals
It's not clear what final output you're looking for. Something like this:? for setidx = 1 : numel(SetOfDataset) point...

10 years ago | 1

| accepted

Answered
Editing the cell array
I'm sure there is a way for |textscan| to read your file in one go, but I always struggle to create a format string that works. ...

10 years ago | 1

| accepted

Answered
After concatenation it is still not concatenated
There's a lot of confusing things in your example. |length| being the height of the matrix, |height| being the width, using |LSB...

10 years ago | 1

Answered
How to speed up for loop with a few calculations?
Your question is far too generic to be able to give a precise answer. The first mistake people do is operate on an array one...

10 years ago | 1

| accepted

Answered
array name indexing in matlab
As Azzi said, created individual arrays is not a good idea. Do read the link that he posted. Individual variables can't be loope...

10 years ago | 3

Answered
How to solve "Error using ' Transpose on ND array is not defined. Use PERMUTE instead." ?
A rgb image has three dimensions: pixel rows, pixel columns, colour planes. It is therefore a 3D matrix. A greyscale image ha...

10 years ago | 2

| accepted

Answered
after using angle to find the phase of a sinus wave how do i know which element in the vector is the correct one?
_"if you want to find the phase of sin(wt+phase), and you use |angle| to do so"_ You completely misunderstood what <http://ww...

10 years ago | 0

Answered
What is the data type of the output of the length function?
The default data type in matlab is double, not integer as in most compiled languages. array lengths, array indices, etc. are all...

10 years ago | 0

| accepted

Load more