Answered
ndgrid on cell array of vectors
What you are asking for is the <https://en.wikipedia.org/wiki/Cartesian_product cartesian product> of the sets. If your cell ...

11 years ago | 1

| accepted

Answered
Create Minesweeper Like Game
Please, use valid matlab syntax in your question, so we don't have to guess if the input is a cell array, a char array, or somet...

11 years ago | 0

Answered
How to determine array equality ?
Possibly, this is what you want: templist = [1 2 0 2 2 0 45 5 0 4 5 1 ...

11 years ago | 0

| accepted

Answered
how to rename images from a folder?
While it's certainly possible to do this in matlab using |dir|, a |for| loop, and some simple path manipulation, there are plent...

11 years ago | 0

Answered
3>2>1 returns logical 0?
You cannot chain comparisons. You have to use logical operators. 3>2>1 is the same as (3>2) > 1 which evaluates...

11 years ago | 2

Answered
I am writting data from one file to another but not getting the expected data?
Two things: fwrite(fid, uint8(inertial_data), 'uint8') This does not write just one sample, but all the samples. More...

11 years ago | 0

| accepted

Answered
How to run two different objects at the same time in different loop?
I'm afraid you're running into a fundamental limitation of matlab. matlab is single threaded, this means only one piece of code ...

11 years ago | 0

Answered
How to display hidden element in matrix when we add the coordinate?
It would help if you used valid matlab syntax in your question, so we don't have to guess whether your input is a cell array, a ...

11 years ago | 0

Answered
How do you find the longest consecutive values of a number in an array?
The simplest way to do what you want is with: max(diff(find(diff([NaN v NaN])))) %where v is the input vector It is triv...

11 years ago | 0

Answered
How do I make a function accept structure and fields as separate inputs?
You can use <http://www.mathworks.com/help/matlab/matlab_prog/generate-field-names-from-variables.html dynamic field names> for ...

11 years ago | 3

| accepted

Answered
How to index cell Matrix with a logical matrix?
Assuming you indeed have a cell array (unlike your example): A = {'a','b','c','d'; 'a','b','c','d'; 'a','b','c','d'} B =...

11 years ago | 1

| accepted

Answered
How to store a specific value in for loop when something happens in that loop
Your dummy example does not work because you're using the same variable name, |n|, for indexing and storing the threshold index....

11 years ago | 1

Answered
How do I see the index values of strfind ?
If you do have a cell array, unlike your example (see comment to your question), and you're trying to match a string in the cell...

11 years ago | 1

Answered
scaled Otsu Binarization or Normalized?
By dividing your original image by the max, you're just normalising the image to the range [0 1]. This has nothing to do with Ot...

11 years ago | 1

| accepted

Answered
Delete rows that contains []
c = {[] 1 NaN [] 1 NaN [] 1 NaN [] 1 NaN [] 1 0 'o_c' 1 1 'w_c' 1 1}; You g...

11 years ago | 0

Answered
Read binary with ascii header
You can still use text reading operation with a binary file, so use |fgetl| (or |fgets|) to read your text (assuming the header ...

11 years ago | 1

Answered
Dynamic Variable (eval=evil ? ) any other solution
Down and down the rabbit hole we go... You started using eval to generate your variables and now in order to use them you need m...

11 years ago | 3

Answered
How to access data that are cells in cells?
*If* you indeed have a 931x1 cell array and each cell contains a 1x30 vector, then m = vertcat(c{:}) %where c is your cell ...

11 years ago | 2

Answered
summing over a multi-dimensional cartesian product using nested arrayfun commands
If I understood correctly, it may be simpler to |ndgrid| your arrays and have a single arrayfun V = @(i,j,k,l) i*j/k+l; ...

11 years ago | 1

| accepted

Answered
Having one for loop instead of two
I'm not sure I understand your problem: Upimage(r, c) = Downimage(ceil(r/2), ceil(c/2)); Upimage(r+1, c) = Downimage(cei...

11 years ago | 0

Answered
how can find frequency from an fft function?
It sounds like you're lacking the basics of fourier transform analysis. You would probably better off learning about it before t...

11 years ago | 0

Answered
Element-by element wise matrix addition of pieces of a matrix
Your code would be much easier to understand, and self-documented, if you used meaningful variable names, as you did for |Overla...

11 years ago | 0

| accepted

Answered
Extracting a message from a picture?
Note that the decoding can be achieved much more efficiently with these three lines of codes: cat = double(imread('Cat.png'...

11 years ago | 1

| accepted

Answered
Saving signal as a text file
One simple way: t = table(t', xt', 'VariableNames', {'Time', 'Amplitude'}); writetable(t, 'somefile.txt');

11 years ago | 0

Answered
How to sum a multiple pairing array matrix from element multiplication of array of cell
If I've understood correctly, you've overcomplicated the summation and it should simply be: B = B + E{n ,m}; within the ...

11 years ago | 0

Answered
Run function in background-- Similar to background Threading in C#
Yair Altman has written <http://undocumentedmatlab.com/blog/explicit-multi-threading-in-matlab-part1 several blog posts> on the ...

11 years ago | 0

Answered
Generate 'k' vectors of unique (non-repetitive) integer random variables in the same range
There's no guarantee that successive calls to randperm will not create repetitions (after all after a while it would have to any...

11 years ago | 1

| accepted

Answered
How to re-produce an existing variable in the script without using it?
Probably the easiest way is to <http://www.mathworks.com/help/releases/R2015b/matlab/ref/save.html save> the variable to a mat f...

11 years ago | 0

Answered
sir, I want to convert hex string to hex, and convert to int16.
The simplest way to stop you going crazy is simply to look in the documentation. Under Matlab -> Language fundamentals -> Data T...

11 years ago | 1

Answered
2d arry sorting
Here's how I'd do it: a = [1 2 3 4 10 11 12 13 19 20 21 22 4 1 3 2 ...

11 years ago | 2

Load more