Answered
weird problem while copying a double value from an array into another.
_"The result becomes [int, double, int, int]"_. No, the result is _[double, double, double, double]_ with some of these double h...

10 years ago | 0

| accepted

Answered
Allocate data into grid boxes
Well, I don't really see the difficulty. Simply use <https://www.mathworks.com/help/matlab/ref/histcounts2.html |histcounts2|> o...

10 years ago | 0

| accepted

Answered
How can I refer to the elements of array cell?
The first issue with your code is with for i = 1 : size(event_list) |size(something)| is always a vector with at least ...

10 years ago | 1

| accepted

Answered
Error using Twitty (line 298) Supplied crudentials are not vaild
Matlab is telling you that line 298 raises an error, not because there's anything wrong with that line , but because the credent...

10 years ago | 1

Answered
hi i have 1x36 cell,each cell contains 7x7 double, i need to divide each 7x7 equally into 4 halves and find max value in each halves,likewise for all 36 cells
yourcellarray = arrayfun(@(~) randi(20, 7), 1:36, 'UniformOutput', false) %demo data cellfun(@(m) cellfun(@(quadrant) ma...

10 years ago | 0

| accepted

Answered
hi i have 1x36 cell,each cell contains 2x2 cell, how to convert it into 4x36 double in matlab
cell2mat(cellfun(@(c) reshape(cell2mat(c),[], 1), yourcellarray, 'UniformOutput', false)) Although if it's a continuation of...

10 years ago | 0

| accepted

Answered
looping through files, filenames varying by number in name gives num2str error
You need to tell matlab that you're concatenating strings, thus wrap your concatenation in |[]|: ['/home/forsker1/Documents...

10 years ago | 0

| accepted

Answered
How to insert two matrices into a matrix?
The first concatenation is simply: [Rprime, tprime; 0 0 0 1] The second: [R, t; 0 0 0 1] and so on.

10 years ago | 0

Answered
Interpolate a 84x60 Cell Array to be 84x120
At a guess, since interpolation of a cell array does not mean much, your data is actually 3 dimensional 84x60x512 and you want t...

10 years ago | 0

Answered
Finding the x value where there area under the curve (from the centre) is 80% of total area
Your normalisation is completely wrong. You need to divide by the total area which is |sum(horizontalProfile1(1:indexOfMax))|, o...

10 years ago | 0

| accepted

Answered
Repeating a vector up to a given length
Unless there's something hidden in some toolbox, I don't think that there is any matlab function to do that in just one line. Re...

10 years ago | 2

Answered
Importing large files to double with a "." as a missing value
Nowadays, there's hardly any reason to use |xlsread| when <https://www.mathworks.com/help/matlab/ref/readtable.html |readtable|>...

10 years ago | 0

| accepted

Answered
how to set the pixel values to 1 and o's based on some threshold values
binaryimage = rgbimage(:, :, 1) > threshold ... red pixels greater than threshold & ...

10 years ago | 1

| accepted

Answered
How to count continuous appearance of numeric values
I'm assuming the N/A are actually NaN, otherwise your question does not make sense as your input is not valid syntax in matlab. ...

10 years ago | 0

Answered
I want to multiply a 400x300x61 matrix with a 61x61 matrix
Result = zeros(size(A, 1), size(A, 2), size(C, 2)); for row = 1:size(A, 1) %don't hardcode matrix size when you can just a...

10 years ago | 0

| accepted

Answered
Indexing into a multidemesional array using a multidimensional array
I think it should rather be: [rows, columns] = ndgrid(1:size(Y, 1), 1:size(Y, 2)); output = X(sub2ind(size(X), Y, rows, ...

10 years ago | 0

| accepted

Answered
How to create a submatrix from a matrix, keeping all columns and a certain number of rows?
The error message clearly tells you what the problem is, the |b:c| vector contains values that are either non-integer or smaller...

10 years ago | 1

| accepted

Answered
Is it possible to make matlab wait for a live user input on excel (opened with ActiveX)?
While you could indeed poll excel through activex and see if a cell has changed, I don't think you can do it with |xlsread| (or ...

10 years ago | 3

| accepted

Answered
How can I convert a datetime vector to cell??
Rather than using obsolete |datestr|, simply convert the |datetime| with |char| (which will use the |Format| of the datetime: ...

10 years ago | 0

Answered
How to get real screen size?
See <http://undocumentedmatlab.com/blog/working-with-non-standard-dpi-displays last week's post on undocumentedmatlab> Saying...

10 years ago | 1

Answered
How can I assign a variable name to each column of a table composed by only one matrix?
array2table(A, 'VariableNames', {'Name1', 'Name2', 'Name3'}) See the <https://www.mathworks.com/help/matlab/ref/array2table...

10 years ago | 4

| accepted

Answered
A and B are coupled vectors. How can I get from A->A_new B-> B_new?
[A_new, ~, columns] = unique(A, 'stable') %stable optional if ordering does not matter B_new = accumarray(columns, B).'

10 years ago | 0

| accepted

Answered
A problem with a matrix
The problem is not with |C|, it's with the |kdu_I|, |kdu_N| and |K_| and potentially |n| (seriously, what useless names! See my ...

10 years ago | 1

| accepted

Answered
In one dimensional cell array, what is faster: 'a{i} = ...' or 'a{i,1} = ...' ?
In theory, the linear indexing |My_vector{i}| should be faster since in the end matlab needs a single offset from the start of t...

10 years ago | 0

Answered
Seeking guidance on how to do programming for function and matrix
I assume _all numbers from 1 to 10_ actually means all integers from 1 to 10, otherwise there's an infinity of numbers... In ...

10 years ago | 1

Answered
Can any one explain me how to apply vectorized operation on the outer for loop of the given program?
As Alexandra pointed out, your example is indexing past the end of the array. Assuming a sufficiently large array, the follo...

10 years ago | 1

Answered
How to efficiently hand a large numbers of constant variables to functions?
Actually, if your function is truly a <http://www.mathworks.com/help/matlab/matlab_prog/nested-functions.html nested function> i...

10 years ago | 0

| accepted

Answered
Matlab object assignment - copy an object instead of creating a pointer
Actually, the default in matlab is that assignment creates a copy. Only classes that are explicitly defined as <http://www.mathw...

10 years ago | 4

| accepted

Answered
Positive and negative elements, and size of matrix at the same time.
Please, clean up the white space and the indenting in your code. It would make it much easier to understand and therefore easier...

10 years ago | 1

Load more