Answered

How to repeatedly subdive vector rectangle into equal area?

How about using histogram2 function? The following is an example. % make dummy data x = 10*rand(30,1); y = 25*rand(30,1); ...

How to repeatedly subdive vector rectangle into equal area?

How about using histogram2 function? The following is an example. % make dummy data x = 10*rand(30,1); y = 25*rand(30,1); ...

3 månader ago | 0

| accepted

Answered

How do you calculate a trajectory through a series of 3D points using cubic splines?

One possible straight-forward way would be like this: Actually, spline interpolation seems to be better than cubic spline... B...

How do you calculate a trajectory through a series of 3D points using cubic splines?

One possible straight-forward way would be like this: Actually, spline interpolation seems to be better than cubic spline... B...

3 månader ago | 1

Answered

How can I find RGB values of a matrix of coordinates of an image?

Another possible solution: row = round(centers(:, 1)); col = round(centers(:, 2)); R = arrayfun(@(x,y) P(x,y,1),row,col); ...

How can I find RGB values of a matrix of coordinates of an image?

Another possible solution: row = round(centers(:, 1)); col = round(centers(:, 2)); R = arrayfun(@(x,y) P(x,y,1),row,col); ...

3 månader ago | 0

Answered

How can I change the retime function in order to do a median(A,'omitnan')?

How about the following? retime(Liv_dom_an, 'monthly', @(x) median(x,'omitnan'))

How can I change the retime function in order to do a median(A,'omitnan')?

How about the following? retime(Liv_dom_an, 'monthly', @(x) median(x,'omitnan'))

3 månader ago | 0

| accepted

Answered

Surface area calculation for irregular shape

How about the following? %% Example in the following page % https://jp.mathworks.com/help/matlab/visualize/visualizing-volume-...

Surface area calculation for irregular shape

How about the following? %% Example in the following page % https://jp.mathworks.com/help/matlab/visualize/visualizing-volume-...

3 månader ago | 0

Answered

Eye Diagram from text file values

The following is one simple example. I hope this would be some help for your research! % Load PRBS pattern D = dlmread('PRBS_...

Eye Diagram from text file values

The following is one simple example. I hope this would be some help for your research! % Load PRBS pattern D = dlmread('PRBS_...

3 månader ago | 0

Answered

How to cluster a network?

How about applying biconncomp function? The following is an example: % Sample Graph s = [1 1 2 2 3 4 4 5 6 6 7 7 8]; t = [2 ...

How to cluster a network?

How about applying biconncomp function? The following is an example: % Sample Graph s = [1 1 2 2 3 4 4 5 6 6 7 7 8]; t = [2 ...

3 månader ago | 0

Answered

Binary String Generator With Minimum Distance

How about using BCH code ? Theoretically, BCH(n,k) encoded binary sequences has minimun distance of bchnumerr(n,k)*2+1. So if ...

Binary String Generator With Minimum Distance

How about using BCH code ? Theoretically, BCH(n,k) encoded binary sequences has minimun distance of bchnumerr(n,k)*2+1. So if ...

3 månader ago | 2

| accepted

Answered

How to prevent envelope crossing through function.

That is due to a characteristics of interpolation method (Spline) used in the envelope function. How about detecting peaks and i...

How to prevent envelope crossing through function.

That is due to a characteristics of interpolation method (Spline) used in the envelope function. How about detecting peaks and i...

3 månader ago | 2

| accepted

Answered

How to plot intensity profile of an image

Hi Warid-san, You can do it by the same way, like the following. I = imread('Capture.PNG'); % Since size(I,2)/2 = 215.5, I ...

How to plot intensity profile of an image

Hi Warid-san, You can do it by the same way, like the following. I = imread('Capture.PNG'); % Since size(I,2)/2 = 215.5, I ...

3 månader ago | 1

Answered

Sorting matrix based on the sum of the rows

Like this? % Read data from CSV A = csvread('Counts.csv'); % Calculate order vector (pt) based on sum(A,2) [~,pt] = sort(s...

Sorting matrix based on the sum of the rows

Like this? % Read data from CSV A = csvread('Counts.csv'); % Calculate order vector (pt) based on sum(A,2) [~,pt] = sort(s...

3 månader ago | 1

| accepted

Answered

How do I extract particular column from unformatted text in .txt file

As mentioned by many experts, it's better to save as .csv format by wireshark. But if you have to do this task from the text fil...

How do I extract particular column from unformatted text in .txt file

As mentioned by many experts, it's better to save as .csv format by wireshark. But if you have to do this task from the text fil...

3 månader ago | 0

| accepted

Answered

regexp: Extract optional named tokens

How about extracting 'Name', 'Gender' and 'ID' one-by-one? The following is an example. % Read the file str = fileread('trip-...

regexp: Extract optional named tokens

How about extracting 'Name', 'Gender' and 'ID' one-by-one? The following is an example. % Read the file str = fileread('trip-...

4 månader ago | 0

Answered

3D Surface or Multiple Line Plots from 16 iterations of 3 column XYZ Data

Like this? data = dlmread('3DDCRXYZ.txt'); g = findgroups(data(:,3)); figure hold on for kk = 1:max(g) idx = g == kk; ...

3D Surface or Multiple Line Plots from 16 iterations of 3 column XYZ Data

Like this? data = dlmread('3DDCRXYZ.txt'); g = findgroups(data(:,3)); figure hold on for kk = 1:max(g) idx = g == kk; ...

4 månader ago | 1

| accepted

Answered

I cannot get the output, Image processing

I think several points should be checked: File path in the line 1 is correct? 3rd input argument of imnoise function should b...

I cannot get the output, Image processing

I think several points should be checked: File path in the line 1 is correct? 3rd input argument of imnoise function should b...

4 månader ago | 0

Answered

How to remove triangles from an image?

How about the following? % Read the original image I = imread('image.jpg'); % Extract orange part (using Color Thresholder ...

How to remove triangles from an image?

How about the following? % Read the original image I = imread('image.jpg'); % Extract orange part (using Color Thresholder ...

4 månader ago | 0

Answered

Convert distance matrix to a table

Or, if you want the full list of (from, to, distance) set, how about the following? rng('default') % For reproducibility X = r...

Convert distance matrix to a table

Or, if you want the full list of (from, to, distance) set, how about the following? rng('default') % For reproducibility X = r...

4 månader ago | 0

Answered

creating a cell with serial names

How about the following? suffix = repmat({'AB_'},15,1); number = cellstr(num2str((1:15)','%02d')); output = strcat(suffix,n...

creating a cell with serial names

How about the following? suffix = repmat({'AB_'},15,1); number = cellstr(num2str((1:15)','%02d')); output = strcat(suffix,n...

4 månader ago | 0

| accepted

Answered

Interpolation of a scatter plot

Seems that scatteredInterpolant function would be better. Here is an example. % Read data file T = readtable('data.xlsx'); ...

Interpolation of a scatter plot

Seems that scatteredInterpolant function would be better. Here is an example. % Read data file T = readtable('data.xlsx'); ...

4 månader ago | 0

| accepted

Answered

Extracting a specific number from an excel cell

How about the following? [~,~,C] = xlsread('yourExcel.xlsx'); C = extractBetween(C,'(',')'); C = extractAfter(C,' '); data...

Extracting a specific number from an excel cell

How about the following? [~,~,C] = xlsread('yourExcel.xlsx'); C = extractBetween(C,'(',')'); C = extractAfter(C,' '); data...

5 månader ago | 0

| accepted

Answered

Create a function and plot it

There are two ways to do this. [Solution 1] a = 500; x = 1:1000; fx = 1 + (a ./ (2.5 + x)); figure plot(x,fx) [Solu...

Create a function and plot it

There are two ways to do this. [Solution 1] a = 500; x = 1:1000; fx = 1 + (a ./ (2.5 + x)); figure plot(x,fx) [Solu...

5 månader ago | 1

| accepted

Answered

Row/column-wise logical indexing

How about the following solution? B = arrayfun(@(k) A(L(:,k),:), 1:size(L,2), 'UniformOutput', false); Then, your can obtain c...

Row/column-wise logical indexing

How about the following solution? B = arrayfun(@(k) A(L(:,k),:), 1:size(L,2), 'UniformOutput', false); Then, your can obtain c...

5 månader ago | 0

Answered

Why is theta=0 not on top

After "Ax = gca;" in your code, please add the following two lines. Ax.ThetaDir = 'clockwise'; Ax.ThetaZeroLocation = 'top';

Why is theta=0 not on top

After "Ax = gca;" in your code, please add the following two lines. Ax.ThetaDir = 'clockwise'; Ax.ThetaZeroLocation = 'top';

5 månader ago | 0

| accepted

Answered

How to obtain exponential equation parameter from probplot function?

I believe fitdist function should be some help.

How to obtain exponential equation parameter from probplot function?

I believe fitdist function should be some help.

5 månader ago | 0

| accepted

Answered

how do I run a .exe within a .m file?

You can use system function to run a .exe. For example, if you save the following line in .m file and run in MATLAB on Windows P...

how do I run a .exe within a .m file?

You can use system function to run a .exe. For example, if you save the following line in .m file and run in MATLAB on Windows P...

5 månader ago | 0

| accepted

Answered

How to add labels to an array or table (after conversion from an array)

This is because some characters (such as '/' ) and white space ' ' are not allowed to use as variable names in table. Also, each...

How to add labels to an array or table (after conversion from an array)

This is because some characters (such as '/' ) and white space ' ' are not allowed to use as variable names in table. Also, each...

5 månader ago | 1

| accepted

Answered

How to print 1x50 array into a text file

How about the following? dlmwrite('output.txt',reshape(A(1:48),8,6)','delimiter','\t'); dlmwrite('output.txt',A(49:50),'-appen...

How to print 1x50 array into a text file

How about the following? dlmwrite('output.txt',reshape(A(1:48),8,6)','delimiter','\t'); dlmwrite('output.txt',A(49:50),'-appen...

5 månader ago | 1

Answered

How to remove or identify spikes in a random signal.

Looking at your data, negative spikes you mentioned is always less than 1000. So, if this condition is applicable to other data,...

How to remove or identify spikes in a random signal.

Looking at your data, negative spikes you mentioned is always less than 1000. So, if this condition is applicable to other data,...

6 månader ago | 0

| accepted

Answered

How to put the values into the specific area and put color

You don't need to use for-loop. The following is one possible solution. A = zeros(70); % Sample 168-by-1 random array with 1...

How to put the values into the specific area and put color

You don't need to use for-loop. The following is one possible solution. A = zeros(70); % Sample 168-by-1 random array with 1...

6 månader ago | 0

| accepted

Answered

How to avoid the repetition of events ?

How about using unique function? p = [6 4 2 3 1 17 17 21 21 27]; p = unique(p,'stable'); The output becomes like this: >> p ...

How to avoid the repetition of events ?

How about using unique function? p = [6 4 2 3 1 17 17 21 21 27]; p = unique(p,'stable'); The output becomes like this: >> p ...

6 månader ago | 0