回答済み
how to reject whole columns based on a condition
No need to use for-loop. Please try the following: A = [5 10 18 13; -2 8 -9 10; 40 47 85 -...

約7年 前 | 0

回答済み
how can I read in this file of varying data types
Another possible solution: fid = fopen('earthquake_data.txt','r'); s = textscan(fid,'%s','Delimiter','\n'); s = s{1}; fclose...

約7年 前 | 0

回答済み
Scatter plot with extra features
How about using quiver function? Here is an example. data = [ % Temp Pres Azim 41 78 45 66 44 0 170 ...

約7年 前 | 0

回答済み
regexprep() skip first occurrence
How about using regexp to find the position of spaces, and delete 2nd~Nth spaces? Like: mystring = 'this is my string'; pos = ...

約7年 前 | 0

| 採用済み

回答済み
How to read only numerical data from irregular .csv file
Since your csv file was saved as a 16-bit text, it's a little bit difficult to use textscan to read data correctly. I think ano...

約7年 前 | 0

回答済み
Help with making a function.
Like this? (Please save the following code as squareRootCheck.m) function y = squareRootCheck(x) if mod(sqrt(x),1) == 0 y =...

約7年 前 | 0

回答済み
symmetric color map using surf
Like this? cmap = interp1([-1;0;1],[1 0 0;0 1 0;1 0 0],linspace(-1,1)'); surf(peaks) colormap(cmap) colorbar

約7年 前 | 1

| 採用済み

回答済み
Creating a matrix from a lagrer matrix
How about the following? In this case, C{1}, C{2}, ..., C{151} are 200-by-1 matrices each, extracted from original 30194-by-1 m...

約7年 前 | 1

| 採用済み

回答済み
write data to header file
How abou the following? % Sample data data = rand(1,800); % Arrange it to comma-separated string str = num2str(data); str...

約7年 前 | 1

| 採用済み

回答済み
How to convert 3d monthly data into season
How about the following? % Sample data Data = rand(56,42,360); % Reshape the data so that each row shows monthly data (42*5...

約7年 前 | 1

| 採用済み

回答済み
Sum quarterly rows into annual results of revenue
How about the following? % Create data table with same structure of yours Date = repelem(datetime(2017,3,1)+3*calmonths(0:3),1...

約7年 前 | 0

回答済み
Mahalanobis distance matrix of an excel dataset
Like this? % Read data from Excel file Data = xlsread('yourExcelFile.xlsx'); % Calculate pair-wise mahalanobis distance D ...

約7年 前 | 0

| 採用済み

回答済み
Trouble using sscanf to find numbers in a string?
Thank you for uploading your data file! How about the following? % Read data file fid = fopen('TemperatureRecord.txt','r'); ...

7年以上 前 | 0

回答済み
How to find shortest distance in 3D?
You can use shortestpath function to find the shortest path between selected nodes. I believe the solution would be looks like t...

7年以上 前 | 2

| 採用済み

回答済み
How to save images as jpgs from .mat files struct
To save matrix as an image, please use imwrite function. In addition, if you save your data as an image file, I would recommend...

7年以上 前 | 0

| 採用済み

回答済み
Creating a table with repeating values
If the size of your variable m_female{1,1}(:,1) is 101-by-1, the following should work. Table_m_xt = table(... ones(101,1),r...

7年以上 前 | 0

回答済み
Load all fields of a struct as input into a function
If your structure Input always has fields Var1 and Var2, a simple solution would be like this. function Var3 = TestFunction(In...

7年以上 前 | 0

| 採用済み

回答済み
How to interpolate in 3d?
You can use scatteredInterpolant to do this task. The following is an example. % Read data file Data = xlsread('Mappe2.xlsx') ...

7年以上 前 | 1

| 採用済み

回答済み
Interpolate positions between 2 matrix
How about the following? % First point position in the matrix M1 = [0 0 0 1 0 0 0; 0 0 0 0 0 0 0; 0 0 0 0 0 0 0; 0 0 0 0 0...

7年以上 前 | 0

| 採用済み

回答済み
I have matrix F (x,y coordinates), which is 1000*2 matrix. i calculated distances between coordinates using PDIST2 command. i want coordinates which are at distance greater than 22?
One possible solution would be like this: F = [x5;y5]'; % x,y coordinates D = pdist(F); % pdist function is suitable in this c...

7年以上 前 | 0

| 採用済み

回答済み
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...

7年以上 前 | 0

回答済み
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...

7年以上 前 | 1

| 採用済み

回答済み
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 ...

7年以上 前 | 0

回答済み
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; ...

7年以上 前 | 0

回答済み
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...

7年以上 前 | 0

回答済み
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....

7年以上 前 | 1

| 採用済み

回答済み
intersect two datetime vectors
The following can find identical timestamp with 0.1 sec tolerance. % Load data load('example1.mat'); % Find identical times...

7年以上 前 | 3

回答済み
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...

7年以上 前 | 0

| 採用済み

回答済み
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...

7年以上 前 | 1

| 採用済み

回答済み
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...

7年以上 前 | 1

さらに読み込む