Answered

second order data fitting using least squares

Another possible solution: x = [0.81 0.85 0.91 1.00 1.17 1.33 1.36 1.37 1.39 1.40 1.42]'; y = [0.58 0.69 0.81 0.93 1 0.91 0.84...

second order data fitting using least squares

Another possible solution: x = [0.81 0.85 0.91 1.00 1.17 1.33 1.36 1.37 1.39 1.40 1.42]'; y = [0.58 0.69 0.81 0.93 1 0.91 0.84...

2 days ago | 0

Answered

How to match Y with X?

How about the following? Running this code, the table T becomes the same as in your desired_output.xlsx. X = readtable('X .xlsx...

How to match Y with X?

How about the following? Running this code, the table T becomes the same as in your desired_output.xlsx. X = readtable('X .xlsx...

4 days ago | 1

| accepted

Answered

how to calculate the standard deviation for each month in monthly time series data of 46 years?

If your goal is to calculate the standard deviation for each month, you don't need to reshape the data to 46X12. The following ...

how to calculate the standard deviation for each month in monthly time series data of 46 years?

If your goal is to calculate the standard deviation for each month, you don't need to reshape the data to 46X12. The following ...

4 days ago | 0

Answered

how to convert to a cell array from a single precision array

Hi Saugata-san, Thank you for providing more details. I believe the following will do the task you explained. a = [1.1 1.2; ...

how to convert to a cell array from a single precision array

Hi Saugata-san, Thank you for providing more details. I believe the following will do the task you explained. a = [1.1 1.2; ...

5 days ago | 0

Answered

Having trouble rotating rectangle shape

Input argument of rotate function shall be a surface, patch, line, text, or image object. How about the following? figure axis...

Having trouble rotating rectangle shape

Input argument of rotate function shall be a surface, patch, line, text, or image object. How about the following? figure axis...

5 days ago | 0

Answered

How to find points inside a country border

How abou the following? (In this script, I have used shape file provided in http://thematicmapping.org/downloads/world_borders....

How to find points inside a country border

How abou the following? (In this script, I have used shape file provided in http://thematicmapping.org/downloads/world_borders....

6 days ago | 1

| accepted

Answered

intersect two datetime vectors

The following can find identical timestamp with 0.1 sec tolerance. % Load data load('example1.mat'); % Find identical times...

intersect two datetime vectors

The following can find identical timestamp with 0.1 sec tolerance. % Load data load('example1.mat'); % Find identical times...

8 days ago | 1

Answered

How can I replace data in a specific address in a text file with new modified data?

Looking at your uploaded data file, I think one possible solution would be like this. % Read all lines in text file fid = fope...

How can I replace data in a specific address in a text file with new modified data?

Looking at your uploaded data file, I think one possible solution would be like this. % Read all lines in text file fid = fope...

8 days ago | 0

| accepted

Answered

Show long path with ... in short label like 'D:\folder\subfolder\...\data'

How abou the following? dirName = 'C:\svn-work\projects\projectname\matlab\mytoolname\data'; c = strsplit(dirName,'\'); dir...

Show long path with ... in short label like 'D:\folder\subfolder\...\data'

How abou the following? dirName = 'C:\svn-work\projects\projectname\matlab\mytoolname\data'; c = strsplit(dirName,'\'); dir...

9 days ago | 1

| accepted

Answered

Extracting numbers from a filename

How about using regular expression? The following is a simple example. fileName = 'data_23.175_75.125'; num = regexp(fileNa...

Extracting numbers from a filename

How about using regular expression? The following is a simple example. fileName = 'data_23.175_75.125'; num = regexp(fileNa...

9 days ago | 0

Answered

Dividing a Matrix into submatrices according to a specific column value

The following is an another way that is easy to understand intuitively: % create a random matrix 10 x 4 A = rand(10,4); % t...

Dividing a Matrix into submatrices according to a specific column value

The following is an another way that is easy to understand intuitively: % create a random matrix 10 x 4 A = rand(10,4); % t...

10 days ago | 0

Answered

button to plot waveforms

Like this? function guiSample() h = figure; uicontrol(... 'Parent', h,... 'Units', 'normalized',... 'Position',...

button to plot waveforms

Like this? function guiSample() h = figure; uicontrol(... 'Parent', h,... 'Units', 'normalized',... 'Position',...

10 days ago | 0

Answered

Any algorithm to separate very high values from a data set?

If you have percentage of outlier (say, 5%), I think you can assume 95th percentiles of a data set as a threshold, like: % Assu...

Any algorithm to separate very high values from a data set?

If you have percentage of outlier (say, 5%), I think you can assume 95th percentiles of a data set as a threshold, like: % Assu...

11 days ago | 0

| accepted

Answered

how can I average monthly Windspeed (Ws) data from 1945-2010. The data loaded into a struct, with 2 fields (data.t and data.ws)

Thank you for sharing your original CSV file. By using readtable and retime functions, you can do this task more easily! Follow...

how can I average monthly Windspeed (Ws) data from 1945-2010. The data loaded into a struct, with 2 fields (data.t and data.ws)

Thank you for sharing your original CSV file. By using readtable and retime functions, you can do this task more easily! Follow...

11 days ago | 0

| accepted

Answered

Merge two text files using uiget

One possible solution would be like this. Just FYI: Since menu function is not recommended in recent MATLAB versions, I have ...

Merge two text files using uiget

One possible solution would be like this. Just FYI: Since menu function is not recommended in recent MATLAB versions, I have ...

16 days ago | 0

Answered

Compare elements and shift the elements up or down based on matching previous or next elements

If x1 contains all elements in x2 and x3, I believe the following code works. x1 = ... ["Liability and Equity"; "Short-te...

Compare elements and shift the elements up or down based on matching previous or next elements

If x1 contains all elements in x2 and x3, I believe the following code works. x1 = ... ["Liability and Equity"; "Short-te...

16 days ago | 0

Answered

Interpolation of angular data spline or linear?

One possible solution would be looks like this. In addition, if you feel @Image Analyst's answer for your previous question usef...

Interpolation of angular data spline or linear?

One possible solution would be looks like this. In addition, if you feel @Image Analyst's answer for your previous question usef...

19 days ago | 1

| accepted

Answered

How to extract 3 distinct curves from a mask into separate matrices?

Assuming your 1018x2038 mask is BW, the following code can extract coordinates of each line. s = regionprops(BW,'PixelList'); ...

How to extract 3 distinct curves from a mask into separate matrices?

Assuming your 1018x2038 mask is BW, the following code can extract coordinates of each line. s = regionprops(BW,'PixelList'); ...

20 days ago | 1

| accepted

Answered

How add ". . ." sign between subplot

I think one possible solution would be like this: figure subplot(1,3,1) plot(magic(4)) subplot(1,3,2,... 'Visible','off'...

How add ". . ." sign between subplot

I think one possible solution would be like this: figure subplot(1,3,1) plot(magic(4)) subplot(1,3,2,... 'Visible','off'...

23 days ago | 0

| accepted

Answered

How do i save URL's of Images at a specific size into a sub-folder of my choosing?

I would recommend using webread, imresize and imwrite functions to do this task. I think the solution would be looks like: % Ex...

How do i save URL's of Images at a specific size into a sub-folder of my choosing?

I would recommend using webread, imresize and imwrite functions to do this task. I think the solution would be looks like: % Ex...

24 days ago | 0

| accepted

Answered

How do I convert a 2d matrix to a 3d matrix?

It's time to use reshape function! Please try the following: A = reshape(C',[2,3,3]);

How do I convert a 2d matrix to a 3d matrix?

It's time to use reshape function! Please try the following: A = reshape(C',[2,3,3]);

26 days ago | 0

| accepted

Answered

sfit型からの2次元等高線の補間

外挿になるので 'lowess' のような手法は使えませんが、scatteredInterpolant 関数を使うと、以下のように線形での内挿・外挿を同時にすることができます。 F = scatteredInterpolant(x1(:),y1(:),z...

sfit型からの2次元等高線の補間

外挿になるので 'lowess' のような手法は使えませんが、scatteredInterpolant 関数を使うと、以下のように線形での内挿・外挿を同時にすることができます。 F = scatteredInterpolant(x1(:),y1(:),z...

1 month ago | 1

Answered

How I can find number of index?

Though the question is not sufficiently clear for me, I think one possible solution would look like this. x = 7.75717; str ...

How I can find number of index?

Though the question is not sufficiently clear for me, I think one possible solution would look like this. x = 7.75717; str ...

1 month ago | 0

Answered

i want x,y coordinates which are randomly generated between 1 to 300 ,condition is distance between every coordinate is >20. how to proceed further

How about the following? BWremain = true(300); % Number of random coordinates N = 5; % Selected coordinates are stored t...

i want x,y coordinates which are randomly generated between 1 to 300 ,condition is distance between every coordinate is >20. how to proceed further

How about the following? BWremain = true(300); % Number of random coordinates N = 5; % Selected coordinates are stored t...

1 month ago | 1

| accepted

Answered

Bubble analysis : how to separate following bubbles ?

By combining some functions, characteristics (equivalent diameter, center, area...etc) of each bubble can be calculated. The fol...

Bubble analysis : how to separate following bubbles ?

By combining some functions, characteristics (equivalent diameter, center, area...etc) of each bubble can be calculated. The fol...

1 month ago | 0

Answered

calculating the average of every pixel in a 3D matrix in a 3x3x3 neighborhood

Since convolution works like a weighted moving average, I believe convn function can do this task. The following is an example. ...

calculating the average of every pixel in a 3D matrix in a 3x3x3 neighborhood

Since convolution works like a weighted moving average, I believe convn function can do this task. The following is an example. ...

1 month ago | 0

Answered

Importing alternating data points

Like this? Using this code, you can extract every 100th value (100th, 200th,...etc) from the 4th column. T = readtable('Dataset...

Importing alternating data points

Like this? Using this code, you can extract every 100th value (100th, 200th,...etc) from the 4th column. T = readtable('Dataset...

1 month ago | 0

Answered

Remove repeat values in a text file

Assuming your data is stored in table variable T >> T T = 7x6 table day month year hour minute temperat...

Remove repeat values in a text file

Assuming your data is stored in table variable T >> T T = 7x6 table day month year hour minute temperat...

1 month ago | 0

| accepted

Answered

How to easily calculate the average distance of a point to all other non-zero points in a binary image?

Assuming BW is your binary image (2D logical array), you can calculate average distance from given point to all non-zero point b...

How to easily calculate the average distance of a point to all other non-zero points in a binary image?

Assuming BW is your binary image (2D logical array), you can calculate average distance from given point to all non-zero point b...

1 month ago | 0

Answered

Import csv data with readtable is incorrect data.

Please specify 'Delimiter' option, like: T = readtable('store_id_relation.csv','Delimiter',','); The result is as follows. ...

Import csv data with readtable is incorrect data.

Please specify 'Delimiter' option, like: T = readtable('store_id_relation.csv','Delimiter',','); The result is as follows. ...

1 month ago | 1

| accepted