Answered

Help with using scanf and editing a txt file?

This is how I'd read all the vertices. %assumptions: % all vertices are made of 3 coordinates % all faces are mad...

Help with using scanf and editing a txt file?

This is how I'd read all the vertices. %assumptions: % all vertices are made of 3 coordinates % all faces are mad...

2 days ago | 0

| accepted

Answered

How to sum 3D arrays in a 1x3 cell?

If I understood correctly you want to interlace the pages: %Assuming cell array is 1x3, not 1x1 as you wrote: numpages =...

How to sum 3D arrays in a 1x3 cell?

If I understood correctly you want to interlace the pages: %Assuming cell array is 1x3, not 1x1 as you wrote: numpages =...

2 days ago | 0

Answered

How to calculate function for different parts of array with values of same lenght in one big array

Assuming the number of elements in the vector is a multiple of 5, you can just <https://www.mathworks.com/help/matlab/ref/reshap...

How to calculate function for different parts of array with values of same lenght in one big array

Assuming the number of elements in the vector is a multiple of 5, you can just <https://www.mathworks.com/help/matlab/ref/reshap...

2 days ago | 0

Answered

Could someone help me with the "imwrite" command please ? Error using imwrite>parse_inputs (line 541) The colormap should have three columns.

The error message is misleading. The problem is that, surprisingly, |imwrite| does not yet support string arrays for the filenam...

Could someone help me with the "imwrite" command please ? Error using imwrite>parse_inputs (line 541) The colormap should have three columns.

The error message is misleading. The problem is that, surprisingly, |imwrite| does not yet support string arrays for the filenam...

2 days ago | 0

Answered

See sequences in array

A = [1 1 1 1 1 0 0 0 0 0 0 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1] A([false, all([A(1:end-2); A(2:end-1); ...

See sequences in array

A = [1 1 1 1 1 0 0 0 0 0 0 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1] A([false, all([A(1:end-2); A(2:end-1); ...

2 days ago | 1

Answered

Save each result in different folders

If OO is supposed to be the generated folder name, then: fid2 = fopen(sprintf('E:\\matlab\\all\\New folder\\New folder (5)\...

Save each result in different folders

If OO is supposed to be the generated folder name, then: fid2 = fopen(sprintf('E:\\matlab\\all\\New folder\\New folder (5)\...

2 days ago | 0

| accepted

Answered

Count the appearances of each value per bin within a vector of 144 bins.

A method without a loop: %demo data: v = randi([-3 2], 1, 21600); binsize = 150; assert(mod(numel(v), binsize) =...

Count the appearances of each value per bin within a vector of 144 bins.

A method without a loop: %demo data: v = randi([-3 2], 1, 21600); binsize = 150; assert(mod(numel(v), binsize) =...

2 days ago | 1

| accepted

Answered

How to Select ROI based on this algorithm. OR how can i segment only the bone part from these images.

_Now I am getting a black squared output at this stage after step 9?_ Well, no wonder considering that your step 9 is: I...

How to Select ROI based on this algorithm. OR how can i segment only the bone part from these images.

_Now I am getting a black squared output at this stage after step 9?_ Well, no wonder considering that your step 9 is: I...

2 days ago | 0

Answered

how to resolve error in code generation when syntex is correct?

Have you tried outer_blob = imfill(bin, 4, 'holes'); in case this is a bug in matlab? (I don't have coder so can't test)...

how to resolve error in code generation when syntex is correct?

Have you tried outer_blob = imfill(bin, 4, 'holes'); in case this is a bug in matlab? (I don't have coder so can't test)...

2 days ago | 0

Answered

Error using xlswrite (line 165) Dimension of input array cannot be higher than two.

The error is clear, |xlswrite| cannot write 3D arrays (such as your V3f array) since excel spreadsheet are 2D. What would yo...

Error using xlswrite (line 165) Dimension of input array cannot be higher than two.

The error is clear, |xlswrite| cannot write 3D arrays (such as your V3f array) since excel spreadsheet are 2D. What would yo...

2 days ago | 0

Answered

remove duplicate rows from text file

lines = strsplit(fileread(yourtextfile), '\n')); %read file and split into lines lines = unique(lines, 'stable'); %remove...

remove duplicate rows from text file

lines = strsplit(fileread(yourtextfile), '\n')); %read file and split into lines lines = unique(lines, 'stable'); %remove...

3 days ago | 0

Answered

if statement on cell

Since your inputs are tables, it's trivial to merge the two tables as you want: C = outerjoin(B, A, 'LeftKeys', 'ID', 'Righ...

if statement on cell

Since your inputs are tables, it's trivial to merge the two tables as you want: C = outerjoin(B, A, 'LeftKeys', 'ID', 'Righ...

3 days ago | 0

| accepted

Answered

How to convert a matrix to a structure array?

I'm with Steven, it would make more sense to keep it as is, or if the columns indeed represent different things, to change it to...

How to convert a matrix to a structure array?

I'm with Steven, it would make more sense to keep it as is, or if the columns indeed represent different things, to change it to...

3 days ago | 0

| accepted

Answered

error message vectors must be the same length

Before you do anything else, the first thing you need to do is to comment your code. The code should start with: %nameofsc...

error message vectors must be the same length

Before you do anything else, the first thing you need to do is to comment your code. The code should start with: %nameofsc...

3 days ago | 0

| accepted

Answered

Problem with function handling

I'm really not clear what are variables (inputs) to your function and what are constants. Why is your anonymous function just a ...

Problem with function handling

I'm really not clear what are variables (inputs) to your function and what are constants. Why is your anonymous function just a ...

4 days ago | 0

Answered

How do I horizontally concatenate tables within a cell array (same # of rows, different # of columns) that contain both numeric and string data types?

So it does look like you want to <https://www.mathworks.com/help/matlab/ref/table.join.html#namevaluepairarguments |join|> the t...

How do I horizontally concatenate tables within a cell array (same # of rows, different # of columns) that contain both numeric and string data types?

So it does look like you want to <https://www.mathworks.com/help/matlab/ref/table.join.html#namevaluepairarguments |join|> the t...

4 days ago | 1

| accepted

Answered

Mapping indices of matrices with differing dimension

Well have you try |x(y)|? It will give you exactly your desired |z|. Note that the rule of |A(B)| indexing is that it is the ...

Mapping indices of matrices with differing dimension

Well have you try |x(y)|? It will give you exactly your desired |z|. Note that the rule of |A(B)| indexing is that it is the ...

4 days ago | 0

| accepted

Answered

Convert time stamps to binary

b = []; b(round(a/0.1)) = 1 The |round| is necessary because of floating point precision.

Convert time stamps to binary

b = []; b(round(a/0.1)) = 1 The |round| is necessary because of floating point precision.

4 days ago | 0

| accepted

Answered

Hi, How do I resize a video to satisfy google net's size input layer ?

_Are you willing to clarify about "pass it each frame of the video."_ Your question is puzzling since at first glance you're ...

Hi, How do I resize a video to satisfy google net's size input layer ?

_Are you willing to clarify about "pass it each frame of the video."_ Your question is puzzling since at first glance you're ...

4 days ago | 0

Answered

How to detect between any two pixels (preferably far) there exist an number of foreground pixels of an image (foreground=white and background=black)???

<https://www.mathworks.com/help/images/ref/improfile.html |improfile|> (with the default |'nearest'| interpolation) should give ...

How to detect between any two pixels (preferably far) there exist an number of foreground pixels of an image (foreground=white and background=black)???

<https://www.mathworks.com/help/images/ref/improfile.html |improfile|> (with the default |'nearest'| interpolation) should give ...

4 days ago | 0

Answered

How can you move up data in a structure to a higher level?

First thing, let's convert all the dataxxx scalar structure into a structure array. The simplest way is to convert your upper le...

How can you move up data in a structure to a higher level?

First thing, let's convert all the dataxxx scalar structure into a structure array. The simplest way is to convert your upper le...

4 days ago | 0

Answered

how swap the bits at position L&P of A(I,j).?

bits = bitget(A(i, j), [L, P]); A(i, j) = bitset(A(i, j), P, bits(1)); A(i, j) = bitset(A(i, j), L, bits(2)); As an a...

how swap the bits at position L&P of A(I,j).?

bits = bitget(A(i, j), [L, P]); A(i, j) = bitset(A(i, j), P, bits(1)); A(i, j) = bitset(A(i, j), L, bits(2)); As an a...

4 days ago | 2

| accepted

Answered

How to write a loop to plot a given range of rows/values from a column text file?

First, I would recommend that you load your data into a table rather than using the old fashioned |textscan|. Tables are much ea...

How to write a loop to plot a given range of rows/values from a column text file?

First, I would recommend that you load your data into a table rather than using the old fashioned |textscan|. Tables are much ea...

5 days ago | 0

Answered

Matlab to write on already open excel file

_My problem is that the connection is made only with the first instance of excel that was open on my computer_ First thing to...

Matlab to write on already open excel file

_My problem is that the connection is made only with the first instance of excel that was open on my computer_ First thing to...

5 days ago | 0

Answered

merge columns of cell array into matrix

Assuming all the tables have the same variable names, then you could convert the cell array of tables into a structure array: ...

merge columns of cell array into matrix

Assuming all the tables have the same variable names, then you could convert the cell array of tables into a structure array: ...

5 days ago | 0

Answered

Matlab COM connection using an actxserver

Most likely, the problem is with your surfer application. The error message you see comes from Windows, not matlab. You could...

Matlab COM connection using an actxserver

Most likely, the problem is with your surfer application. The error message you see comes from Windows, not matlab. You could...

6 days ago | 0

| accepted

Answered

creation of a dynamic matrix

A = [1 2 3; 4 5 6] newrow = [7 8 9]; %add a row to existing matrix: A = [A; newrow] %or %A(end+1, :) ...

creation of a dynamic matrix

A = [1 2 3; 4 5 6] newrow = [7 8 9]; %add a row to existing matrix: A = [A; newrow] %or %A(end+1, :) ...

6 days ago | 0

| accepted

Answered

how to divise an image on 2d to 6 segments with matrix rotation ?

Use <https://www.mathworks.com/help/releases/R2018b/matlab/ref/hold.html |hold on|> after your first plot to stop new plots over...

how to divise an image on 2d to 6 segments with matrix rotation ?

Use <https://www.mathworks.com/help/releases/R2018b/matlab/ref/hold.html |hold on|> after your first plot to stop new plots over...

6 days ago | 0

| accepted

Answered

Undefined function or variable

Function can't see the variables in your main workspace. You have to pass any variable you want to use to the function. Chang...

Undefined function or variable

Function can't see the variables in your main workspace. You have to pass any variable you want to use to the function. Chang...

7 days ago | 0

| accepted

Answered

Maximising Pixels within Certain area of Matrix

_One whose sum of pixel values is the greatest_ Convolve your matrix with an array of 1 the same size as the area. The locati...

Maximising Pixels within Certain area of Matrix

_One whose sum of pixel values is the greatest_ Convolve your matrix with an array of 1 the same size as the area. The locati...

9 days ago | 0

| accepted