Answered
unique() function not working in external mode
_I found the cause of the problem: unique() can't tell that two zeros are the same_ More likely, your two zeros are not the s...

9 years ago | 0

Answered
Replot a matlab.graphics.chart
JB, looking at the various comments in this question, I've got the feeling that you're not totally understand what it is that th...

9 years ago | 1

| accepted

Answered
Remove negative values of elements in a cell array
a = cellfun(@(v) v(v >= 0), a, 'UniformOutput', false); Or use an explicit loop: for idx = 1:numel(a) a{idx} = a...

9 years ago | 3

| accepted

Answered
Loop with strings array
_Because I haven't understood past answers to a similar question_ The only similar question I can find that you've asked is <...

9 years ago | 0

Answered
Identify which color zone a x - y point is in
As per José-Luis' comment, using numbered variables is a bad idea. In your case, it's going to make the code harder to expand as...

9 years ago | 0

| accepted

Answered
How to solve "index exceeds matrix dimension" while using imread
The error is not in |imread|, the error is on line 3 of your program as the message says. My suspsicion is that |files| is empty...

9 years ago | 0

| accepted

Answered
Number of pixels in a threshold image?
It's trivial to do: pixelcount = nnz(yourimage > yourthreshold)

9 years ago | 0

| accepted

Answered
is this the right code ?
The code may or may not be correct. I've not wasted the time checking every single line is correct as it's so horribly written. ...

9 years ago | 0

Answered
How to call the C# function with one or two ref type arguments?
Have a look at the function signature with <https://uk.mathworks.com/help/matlab/ref/methodsview.htm |methodsview|> or <https://...

9 years ago | 0

| accepted

Answered
Attempted to access x(12); index out of bounds because numel(x)=11.
For your first piece of code, nothing guarantees that |x| is the same length as |y|. For your second piece of code, you assig...

9 years ago | 0

| accepted

Answered
Need help with a syntax
The <https://uk.mathworks.com/help/matlab/ref/fix.html |fix|> function is also available in matlab, if that's what you're asking...

9 years ago | 0

Answered
Assign multidimensional array 'slice' or 'chunk'
Use <https://uk.mathworks.com/help/matlab/ref/sub2ind.html |sub2ind|>. However, your vector will have to be repmat'ed for each c...

9 years ago | 0

Answered
How to convert jpg image as transparent image ?
Your question is extremely unclear. What does _convert [anything] into a transparent image_ mean? If you start with a non-transp...

9 years ago | 1

Answered
How can I change this line?
<https://uk.mathworks.com/help/matlab/release-notes.html?searchHighlight=avifile&s_tid=doc_srchtitle |avifile|> was deprecated i...

9 years ago | 0

| accepted

Answered
delete empty cells of data array
@JB, Stephen's comment is spot on. It may not seem like a big deal to you but your language and your syntax is very imprecise an...

9 years ago | 1

Answered
Confusion in Addition: adding 1:4 to a matrix of 1X4 gives resultant matrix of 1X5
Because of <https://www.mathworks.com/help/matlab/matlab_prog/operator-precedence.html operator precedence>, |+| has more priori...

9 years ago | 0

| accepted

Answered
Randperm a completely different set of numbers each loop
You can always |setdiff| your previous set from the set you pass to |randperm|: currentset = []; fullset = 1:100; whi...

9 years ago | 0

Answered
Extract non zero term from Vector
A quick search for "simulink nonzeros" returns as its first link this <https://uk.mathworks.com/help/simulink/slref/find.html |f...

9 years ago | 1

| accepted

Answered
Add matrix to matrix
In your particular example, and assuming that |E| is supposed to have 4 elements instead of the 3 you've written: F = A + [...

9 years ago | 0

Answered
How to evalutate AREA from connected points?
There are a fair number of <https://uk.mathworks.com/help/matlab/ref/graph-object.html graph> analysis functions that were intro...

9 years ago | 1

Answered
Is possible to compile a .m File using Windows SDK 7.1 as compatible compiler?
First, the windows SDK (whichever version) is *not a compiler* and does not include any compiler. It is just a bunch of code, do...

9 years ago | 2

Answered
How can I input a table of variables into a for loop and output the results to a table?
Assuming that you've not made any error in your formulas, each iteration of the |d| loop is just multiplying |mmhgo| by a consta...

9 years ago | 0

| accepted

Answered
Use linspace without scalar input?
x = 0.01; y = [1.01, 3.01]; %would be better as a column vector as you wouldn't to tranpose it in the arrayfun n = 10; ...

9 years ago | 1

| accepted

Answered
(How to use a constant matrix in arrayfun?) or (How to call an array of matrix-elements , given the indices in 2 arrays?)
As said, with the code provided the bottleneck is the |find_orig| function. If you can find a way so that it returns arrays of |...

9 years ago | 0

| accepted

Answered
How to extract time (HH:mm) from datetime from a table and plot it in interval range?
Note that the format of the |datetime| array is irrelevant. It is only used for display. You could of course change the |Format|...

9 years ago | 2

| accepted

Answered
I am having an issue concatenating two cell arrays.
A simpler method to the accepted answer, using the newly introduced |string| class (R2016b or later): vclass = {'100kV','15...

9 years ago | 0

Answered
How to check a number is in a array or not?
Use <https://uk.mathworks.com/help/matlab/ref/ismember.htm |ismember|>: ismember(5, a)

9 years ago | 15

| accepted

Answered
How to load a folder according to a vector into matlab?
As per Jan's questions, it's really not clear what exactly you want to do. The following will load all the images in a cell arra...

9 years ago | 0

Answered
parsing XML file with defined format
There is no need for any toolbox to parse xml in matlab. <https://www.mathworks.com/help/matlab/ref/xmlread.html |xmlread|> will...

9 years ago | 1

Answered
display current time in minutes
hour(datetime)*60 or hour(datetime)*60 + minute(datetime) if you want to add the minutes.

9 years ago | 1

| accepted

Load more