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 ...

3 maanden 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...

3 maanden 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...

3 maanden 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'); ...

3 maanden 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...

3 maanden 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...

3 maanden 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...

4 maanden 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';

4 maanden 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.

4 maanden 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...

4 maanden 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...

4 maanden 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...

4 maanden 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,...

5 maanden 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...

5 maanden 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 ...

5 maanden ago | 0

Answered

How to specify line color using a hexadecimal color code

It would be due to your MATLAB version. Hexadecimal color code can be used in the latest version (R2019a). If your version is R...

How to specify line color using a hexadecimal color code

It would be due to your MATLAB version. Hexadecimal color code can be used in the latest version (R2019a). If your version is R...

5 maanden ago | 1

| accepted

Answered

Extract rows in one array based on time values in a another array +20 seconds

Simple and straight-forward way would be like this. Just in case, I have saved your truncated example of array A and B as .mat ...

Extract rows in one array based on time values in a another array +20 seconds

Simple and straight-forward way would be like this. Just in case, I have saved your truncated example of array A and B as .mat ...

5 maanden ago | 0

| accepted

Answered

HOW TO CONVERT A PNG IMAGE IN TO A EPS IMAGE?

Like this? % Read png file I = imread('peppers.png'); % Show the image figure imshow(I,'Border','tight') % Save as eps...

HOW TO CONVERT A PNG IMAGE IN TO A EPS IMAGE?

Like this? % Read png file I = imread('peppers.png'); % Show the image figure imshow(I,'Border','tight') % Save as eps...

5 maanden ago | 0

Answered

How to mask out the object in the image?

How about the following? % Read and binarize your image I = imread('ms.jpg'); Igray = rgb2gray(I); BW = imbinarize(Igray); ...

How to mask out the object in the image?

How about the following? % Read and binarize your image I = imread('ms.jpg'); Igray = rgb2gray(I); BW = imbinarize(Igray); ...

5 maanden ago | 0

Answered

Find at least 5 consecutive values above a certain threshold in a vector?

If there are 2 or more consective values above the threshold, the following is one possible solution. (* The following needs Im...

Find at least 5 consecutive values above a certain threshold in a vector?

If there are 2 or more consective values above the threshold, the following is one possible solution. (* The following needs Im...

5 maanden ago | 1

Answered

How to make a rainbow in MatLab?

One possible way: t = linspace(0,pi)'; x = cos(t); y = sin(t); color = jet(7); figure hold on for kk = 1:7 plot((2+k...

How to make a rainbow in MatLab?

One possible way: t = linspace(0,pi)'; x = cos(t); y = sin(t); color = jet(7); figure hold on for kk = 1:7 plot((2+k...

5 maanden ago | 0

| accepted

Answered

noise removal from image

If the noise is exactly horizontal, one straight-forward solution would be like this: % Read your image and convert it to gray-...

noise removal from image

If the noise is exactly horizontal, one straight-forward solution would be like this: % Read your image and convert it to gray-...

5 maanden ago | 0

| accepted

Answered

How to find the last nonzero entry in all rows of a sparse matrix?

How about the following? [Solution 1] A = [1 3 0 0 0 0;0 4 2 3 0 0;5 0 0 1 4 0]; pos = nan(size(A,1),1); for kk = 1:size(A...

How to find the last nonzero entry in all rows of a sparse matrix?

How about the following? [Solution 1] A = [1 3 0 0 0 0;0 4 2 3 0 0;5 0 0 1 4 0]; pos = nan(size(A,1),1); for kk = 1:size(A...

5 maanden ago | 0

| accepted

Answered

making an array to skip missing data for mean calculations

If you want to calculate mean value for each column with ignoring -999 value, how about the following solution? % Assuming your...

making an array to skip missing data for mean calculations

If you want to calculate mean value for each column with ignoring -999 value, how about the following solution? % Assuming your...

5 maanden ago | 0

Answered

How to group a matrix based on height

If you have Image Processing Toolbox, you can do this task easier by using bwlabel function. The following is a simple example. ...

How to group a matrix based on height

If you have Image Processing Toolbox, you can do this task easier by using bwlabel function. The following is a simple example. ...

5 maanden ago | 0

Answered

Spline interpolation is giving me errors with array index

At least the latest version R2019a, your code works well. Anyway, I would recommend adjusting vector direction of t and xx, lik...

Spline interpolation is giving me errors with array index

At least the latest version R2019a, your code works well. Anyway, I would recommend adjusting vector direction of t and xx, lik...

6 maanden ago | 0

Answered

how to Interpolate hourly data

Hmm, interesting problem. I think the following is one possible straight-forward solution. % Read data file D = dlmread('test...

how to Interpolate hourly data

Hmm, interesting problem. I think the following is one possible straight-forward solution. % Read data file D = dlmread('test...

6 maanden ago | 1

| accepted

Answered

split a rectangular matrix

How about the following? input = [1 0 0 0; 0 1 0 0; 0 0 1 0]; output = zeros([size(input),size(input,1)]); for kk = 1:siz...

split a rectangular matrix

How about the following? input = [1 0 0 0; 0 1 0 0; 0 0 1 0]; output = zeros([size(input),size(input,1)]); for kk = 1:siz...

6 maanden ago | 1

| accepted

Answered

how do I plot this vector graphs?

The vector plot for the problem 1-(a) will be like this. Now, I would recommend trying to do the same thing for the remaining pr...

how do I plot this vector graphs?

The vector plot for the problem 1-(a) will be like this. Now, I would recommend trying to do the same thing for the remaining pr...

6 maanden ago | 0

Answered

3D Matrix (n*m*p) in Table

How about the following? % Sample data (n,m,p were assumed to be 20,10,5,respectively) A = rand(20,10,5); % Save as an Exce...

3D Matrix (n*m*p) in Table

How about the following? % Sample data (n,m,p were assumed to be 20,10,5,respectively) A = rand(20,10,5); % Save as an Exce...

6 maanden ago | 0

| accepted