Answered

How to delete a loaded variable with a changing name in a for loop?

The whole mess would have been avoided if you'd given an output to load. That would remove the need for |eval| and for clearing ...

How to delete a loaded variable with a changing name in a for loop?

The whole mess would have been avoided if you'd given an output to load. That would remove the need for |eval| and for clearing ...

3 days ago | 1

Answered

How to filter parts of a structure based on string contents?

_and more_ Details of and more would be useful to answer the question properly. Assuming you want all files that start wit...

How to filter parts of a structure based on string contents?

_and more_ Details of and more would be useful to answer the question properly. Assuming you want all files that start wit...

3 days ago | 0

Answered

How do I transpose a vector within a cell?

cellfun(@tranpose, yourcellarray, 'UniformOutput', false) However, there's little point in using a cell array if all your v...

How do I transpose a vector within a cell?

cellfun(@tranpose, yourcellarray, 'UniformOutput', false) However, there's little point in using a cell array if all your v...

4 days ago | 0

| accepted

Answered

Vectorized method to sum missed one values

You can replace the earlier part of this answer by the compiled version of <https://www.mathworks.com/matlabcentral/fileexchange...

Vectorized method to sum missed one values

You can replace the earlier part of this answer by the compiled version of <https://www.mathworks.com/matlabcentral/fileexchange...

4 days ago | 1

Answered

Mex Programming: How can I know the length of a struct array that is a field of a parent struct?

You misunderstood what the index refers to. It's the index of the parent structure, not of the field. So for structure root...

Mex Programming: How can I know the length of a struct array that is a field of a parent struct?

You misunderstood what the index refers to. It's the index of the parent structure, not of the field. So for structure root...

4 days ago | 1

| accepted

Answered

What‘s the meaning of imshow(im1*2^4); ？

Display an image with its intensity multiplied by 16. If you don't know why it's multiplied by 16, ask the author of that cod...

What‘s the meaning of imshow(im1*2^4); ？

Display an image with its intensity multiplied by 16. If you don't know why it's multiplied by 16, ask the author of that cod...

5 days ago | 0

| accepted

Answered

creating algorithm for specific computation

If I understood correctly: numerators = t - repmat(et(:), 1, numel(et)); %calculate t-et(1), t-et(2), etc. numerators(l...

creating algorithm for specific computation

If I understood correctly: numerators = t - repmat(et(:), 1, numel(et)); %calculate t-et(1), t-et(2), etc. numerators(l...

5 days ago | 1

| accepted

Answered

Distance between distance between [ x_0,y_00] to [x_10,y_100] coordinates in Cell array

I would build a <https://www.mathworks.com/help/matlab/ref/digraph.html |digraph|> from your cell array, where each node is a po...

Distance between distance between [ x_0,y_00] to [x_10,y_100] coordinates in Cell array

I would build a <https://www.mathworks.com/help/matlab/ref/digraph.html |digraph|> from your cell array, where each node is a po...

5 days ago | 1

| accepted

Answered

I got data with a lot of zeros. Now i want to empty every cell with a zeros, but i don't want to remove the cell from my data set. I got this: The data set is 20535x1536

A *matrix* cannot have empty cells. They must have a value. My suggestion is to use NaN (not a number) to mark those cells you c...

I got data with a lot of zeros. Now i want to empty every cell with a zeros, but i don't want to remove the cell from my data set. I got this: The data set is 20535x1536

A *matrix* cannot have empty cells. They must have a value. My suggestion is to use NaN (not a number) to mark those cells you c...

5 days ago | 0

Answered

Comparing two vectors to keep an entry of every value.

One way: uvals = unique([A, B]); valcount = max(histcounts(A, [uvals, Inf]), histcounts(B, [uvals, Inf])); C = repele...

Comparing two vectors to keep an entry of every value.

One way: uvals = unique([A, B]); valcount = max(histcounts(A, [uvals, Inf]), histcounts(B, [uvals, Inf])); C = repele...

5 days ago | 0

Answered

Typecasting a matrix of 200x8 uint8 to double

Transpose your |a| before reshaping into a vector: convert_double = typecast(reshape(uint8(a'), 1, []), 'double')

Typecasting a matrix of 200x8 uint8 to double

Transpose your |a| before reshaping into a vector: convert_double = typecast(reshape(uint8(a'), 1, []), 'double')

5 days ago | 1

Answered

Error matrix index is out of range for deletion?

_I don't understand what I am doing wrong_ Lots! As KSSV commented, first is the use of |eval|. |eval| is typically used b...

Error matrix index is out of range for deletion?

_I don't understand what I am doing wrong_ Lots! As KSSV commented, first is the use of |eval|. |eval| is typically used b...

6 days ago | 1

Answered

How to separate a table into sub-tables by unique categories?

As said, it is much easier to calculate statistics by location if you don't split the table. You don't need to filter the table ...

How to separate a table into sub-tables by unique categories?

As said, it is much easier to calculate statistics by location if you don't split the table. You don't need to filter the table ...

6 days ago | 0

Answered

Determine if there are 3 consecutive rows and columns in a list of subscripts

One option: hasconseccols = any(accummarray(A(:, 1), A(:, 2), [], @(v) ~isempty(strfind(sort(diff(v))', [ 1 1])))) hasco...

Determine if there are 3 consecutive rows and columns in a list of subscripts

One option: hasconseccols = any(accummarray(A(:, 1), A(:, 2), [], @(v) ~isempty(strfind(sort(diff(v))', [ 1 1])))) hasco...

6 days ago | 0

Answered

I want to read differently from xlsread as a uigetfile .csv

You request makes no sense. <https://www.mathworks.com/help/matlab/ref/uigetfile.html |uigetfile|> does not read files. It promp...

I want to read differently from xlsread as a uigetfile .csv

You request makes no sense. <https://www.mathworks.com/help/matlab/ref/uigetfile.html |uigetfile|> does not read files. It promp...

6 days ago | 0

Answered

How can I do to avoid using eval?

The code to fix is not the one you show unfortunately, It's the code before that which creates all these numbered I variables. ...

How can I do to avoid using eval?

The code to fix is not the one you show unfortunately, It's the code before that which creates all these numbered I variables. ...

6 days ago | 0

Answered

This is amy code it is not working why?

The problem is the dot after |exp| that shouldn't be there and the missing dots before the two * % v-----------...

This is amy code it is not working why?

The problem is the dot after |exp| that shouldn't be there and the missing dots before the two * % v-----------...

10 days ago | 0

Answered

Help preallocating variables for a table

_C is a matrix with doubles in it_ In that case, function caTable = makeCaTable(caCM) %doc goes here % caCM...

Help preallocating variables for a table

_C is a matrix with doubles in it_ In that case, function caTable = makeCaTable(caCM) %doc goes here % caCM...

10 days ago | 0

| accepted

Answered

error on accessing images reading from sub folders.

Assuming that |numberOfImageFiles| is indeed the number of image files, why are you passing that to |rgb2gray| which expects an ...

error on accessing images reading from sub folders.

Assuming that |numberOfImageFiles| is indeed the number of image files, why are you passing that to |rgb2gray| which expects an ...

11 days ago | 0

| accepted

Answered

Why am I getting an error of subscripted assignment dimension mismatch

_Do you think that from what i explained of what should i do the code is wrong? then how should I do it?_ The code you have w...

Why am I getting an error of subscripted assignment dimension mismatch

_Do you think that from what i explained of what should i do the code is wrong? then how should I do it?_ The code you have w...

11 days ago | 1

| accepted

Answered

Extracting the XY + RGB value from an image.

Assumming your LED array has as many leds as pixels in the GIF, then the following code should translate the GIF into the CRGB a...

Extracting the XY + RGB value from an image.

Assumming your LED array has as many leds as pixels in the GIF, then the following code should translate the GIF into the CRGB a...

11 days ago | 1

| accepted

Answered

fprintf with repeating labels and numbers

First a warning, never use |length| on a matrix. If your |x| has less than 3 rows or if you ever increase the number of columns ...

fprintf with repeating labels and numbers

First a warning, never use |length| on a matrix. If your |x| has less than 3 rows or if you ever increase the number of columns ...

12 days ago | 1

| accepted

Answered

Why is it showing " Image is too big to fit on screen; displaying at 67% " while processing a video?

Well, the message is clear, you're displaying an image (with |imshow|) and the size of the image is bigger than the size of your...

Why is it showing " Image is too big to fit on screen; displaying at 67% " while processing a video?

Well, the message is clear, you're displaying an image (with |imshow|) and the size of the image is bigger than the size of your...

12 days ago | 1

| accepted

Answered

How to save image file (.png) in a .mat structure?

I'm not sure what you think |image| does. It's a function to display a matrix as an image. For an image, you'd be better off usi...

How to save image file (.png) in a .mat structure?

I'm not sure what you think |image| does. It's a function to display a matrix as an image. For an image, you'd be better off usi...

12 days ago | 0

Answered

Fast reshaping or squeezing

_I need to reshape A to dimension 6x200000._ I assume you mean you need to reshape the 1x6x200000 submatrix to 6x200000. ...

Fast reshaping or squeezing

_I need to reshape A to dimension 6x200000._ I assume you mean you need to reshape the 1x6x200000 submatrix to 6x200000. ...

12 days ago | 0

| accepted

Answered

calculated HSV and their mean (highest and lowest values) and std deviation of 120 (same resolution) fire images.now want to detect fire from random random images by specifying high and low values of HSV.i get all values of tht within ranges. plzhelp

_Can I differentiate fire images from non-fire images comparing the values of the mean of HSV values_ No, not reliably. You m...

calculated HSV and their mean (highest and lowest values) and std deviation of 120 (same resolution) fire images.now want to detect fire from random random images by specifying high and low values of HSV.i get all values of tht within ranges. plzhelp

_Can I differentiate fire images from non-fire images comparing the values of the mean of HSV values_ No, not reliably. You m...

13 days ago | 0

Answered

How to convert thermal image(From FLIR T400) into corresponding temperature in matlab?

The image you get from an infrared camera should be greyscale. Typically, the camera software may use false colours to make it e...

How to convert thermal image(From FLIR T400) into corresponding temperature in matlab?

The image you get from an infrared camera should be greyscale. Typically, the camera software may use false colours to make it e...

13 days ago | 0

Answered

how to write this c++ code in matlab form

_is it correct_ Certainly not! It doesn't look like you know what the <https://www.mathworks.com/help/matlab/ref/zeros.html |...

how to write this c++ code in matlab form

_is it correct_ Certainly not! It doesn't look like you know what the <https://www.mathworks.com/help/matlab/ref/zeros.html |...

13 days ago | 0

Answered

generate increasing exponential series for 10 numbers with sum equal 1.

v = rand(1, 10); v = sort(v) / sum(v) would be one way to generate a <https://en.wikipedia.org/wiki/Monotonic_function m...

generate increasing exponential series for 10 numbers with sum equal 1.

v = rand(1, 10); v = sort(v) / sum(v) would be one way to generate a <https://en.wikipedia.org/wiki/Monotonic_function m...

13 days ago | 0

| accepted

Answered

How to display indexed images from .mat file using colormap?

Having looked at the code for your |displayData|, it is not possible to use it with indexed images with different colour maps wi...

How to display indexed images from .mat file using colormap?

Having looked at the code for your |displayData|, it is not possible to use it with indexed images with different colour maps wi...

13 days ago | 0