Answered
Plot occurence of each element in an array
Your code commented: length = HW(:,1); %You're creating a length variable (which has nothing to do with length) which wi...

10 years ago | 1

| accepted

Answered
How to retrieve specific rows that the coordinates x,y have been saved in another matrix?
The problem with your statement is that it finds all rows of |Data| whose |x| match an |x| in |Points| and match any |y| in |Poi...

10 years ago | 0

Answered
Recursive elimination of minimum number in a array
Seems fairly straightforward to me. As I assume this is homework, I won't give you a complete solution but I'd use < |unique|> t...

10 years ago | 0

Answered
when I execute the code i get this errors can anybody help
Well, the error message is clear. The function |mex_pb_parts_final_selected| is not found. Assuming you haven't changed matlab's...

10 years ago | 0

Answered
Hi! I need to verify my code of this funtion! thanks
Jan is spot on with variable names. Use meaningful words, not abbreviations or one or two letter names. It makes it so much easi...

10 years ago | 0

Answered
Making an RGB image
I don't understand why you're going about it the way you're doing. It would be much simpler to do: A2 = A; and be done w...

10 years ago | 2

Answered
Sum of matrix with variable dimension
I'm not sure what should happen when |N(y,x) < N0|, should the result be 0? If I understand correctly, this will do: arr...

10 years ago | 0

| accepted

Answered
Why do I get an index error?
It's not clear what you're trying to do with your code, but clearly it's not going to work |r3| is a vector with values betwe...

10 years ago | 0

Answered
Why does the red plane contain the whole image?
The problem is one of |double| vs |uint8|. Your original image is of type |uint8|, so are |Rplane|, |Gplane| and |Bplane|. ...

10 years ago | 1

| accepted

Answered
Changing matrix into order pairs
Neither of the two examples you show are remotely valid syntax in matlab since a matrix can only store a single scalar number pe...

10 years ago | 1

Answered
Index information for conv2(.,.)
One possible way: indices = reshape(1:numel(X), size(X)); usedindices = nlfilter(indices, size(Y), @(idx) {idx(:)}); ...

10 years ago | 0

| accepted

Answered
how to use unique command for the structured array
Assuming you actually meant a structure such as the one created by: a = struct('fit', {[5;7], [3;8], [5;7]}, 'z', {'Sunday'...

10 years ago | 4

| accepted

Answered
Shared library problems C++
From a matlab point of view there is nothing wrong with what you've written (I'd use |numel| instead of |length|, it's safer, bu...

10 years ago | 0

Answered
turn a table column into doubles
yourtable.columnname = str2double(yourtable.columnname); is all that is needed.

10 years ago | 7

| accepted

Answered
How to loop over a function again?
Probably a simpler way of writing these loops would be with: function loop(N, netCostMatrix) %where are the outputs? ...

10 years ago | 0

Answered
string to number conversion with mixed values
It looks like you're asking two things: * how to create variables named from the content of a string, * how to get the index...

10 years ago | 0

Answered
how to change or compliment a particular bit in the binary string?
Note that in your example |b| is not |110010| but |'110010'|. The difference is important, |b| is an array of *character*, not a...

10 years ago | 2

Answered
Aggregate Data in a large matrix using unique identifiers.
A=[5 2 1 3; 4 3 7 5; 5 1 1 1; 3 1 2 7; 4 1 5 8]; [ids, ~, subs] = unique(A(:, 1)); B = [ids, cell2mat(accumarray(subs, 1...

10 years ago | 0

Answered
How to get 1807 point data array to 1806 data array?
As Marc says, you need a vector for the query points but his solution for generated that vector does not make much sense. A g...

10 years ago | 2

Answered
webread.m - odd behavior in 2016B.
I can't reproduce the error you get with |webread| on R2016b (win7 but that shouldn't matter). |webread| returns exactly the sam...

10 years ago | 0

| accepted

Answered
Does Matlab can give me the formatSpec of a text file without manual inputs ?
<https://www.mathworks.com/help/matlab/ref/readtable.html |readtable|> is a more advanced version of |textscan| (and easier to u...

10 years ago | 0

Answered
how to properly sort data from a database into a cell structure ?
Coming from C++, I would think it is obvious that dynamic variable names are a no no. It's not even possible in C++. In any case...

10 years ago | 0

| accepted

Answered
Smooth a grid horizontally using interp2
Did you make a mistake in the names of the input to |interp2|. I would have thought the correct call would be: Vq = interp2...

10 years ago | 0

| accepted

Answered
Find Function in Matlab
This should work: xpeaks = find(X); assert(xpeaks(1) ~= 1, 'Peak on first value, can''t go back before peak'); delay ...

10 years ago | 0

| accepted

Answered
Is the ismember function buggy?
There is nothing wrong with |ismember|. You're testing how many elements of |A| are in |B|, not how many of |B| are found in |A|...

10 years ago | 0

Answered
Is histogram('BinEdges',edges,'BinCounts',counts) broken or deprecated?
It's not deprecated, it's brand new in R2016b. I suspect you're on an older version.

10 years ago | 0

| accepted

Answered
How to convert decimal matrix matrix into binary matrix?
Note there's not such thing as b=[1010 1001 1000 0111 1001 0111 1001 0110 0001 0010 0011 1000] in matlab. B...

10 years ago | 0

| accepted

Answered
Exceed matix dimensions when loading images in random order.
There is nothing that can potentially contain images in your code. You only have vectors of integers. I have no idea what you...

10 years ago | 0

Answered
replace zeros according to distribution of integers in each column
If I understand correctly, you want to replace all zeros in a column by random non-zero values from the same column? In which c...

10 years ago | 0

| accepted

Answered
How to inner join two matrices?
[~, row1, row2] = intersect(tbl1(:, [1 2]), tbl2(:, [1 2]), 'rows'); tbl3 = [tbl1(row1), tbl2(row2, 3)]; tbl3(:, 5) = di...

10 years ago | 0

| accepted

Load more