Answered
Half hour data to monthly average
If your data is stored in timetable format, you can do that simply using <https://jp.mathworks.com/help/matlab/ref/retime.html |...

8 years ago | 0

Answered
A value belongs to an interval
I think what you want to do would be like this. BTW, |display| function is not recommended. Please use |disp| function instead. ...

8 years ago | 0

Answered
How to delete multiple elements of an array using for loop?
You don't need to use for-loop. Please try the following: idx = mod(x-1,1000) < 500; x(idx)=[];

8 years ago | 0

Answered
Store 0 as 0.0
How about using |regexprep| to add '.0' for integer values? Here is an example. x = [0.0 12.0 3.1]; str = jsonencode(x...

8 years ago | 0

| accepted

Answered
Dividing a set of values into groups
Here is one possible solution. % Your data x = [-2,-7,-1,-6,-1,-5,-2,-3,-1]; % Number of group nGroup = 4; ...

8 years ago | 3

| accepted

Answered
Dividing set of data into groups and evaluating the mean of each group
Another way: x = rand(5000,1); g = repelem(1:100,50)'; avg = splitapply(@mean,x,g);

8 years ago | 0

Answered
creating time date matrix
OK, here is more generalized script. Writing this way, you can flexibly change the starting and ending date, and generate the co...

8 years ago | 0

Answered
creating time date matrix
One possible solution would be like this. T = datetime(2000,1,1):hours(1):datetime(2000,1,1,23,0,0); T = repmat(T,366,1); ...

8 years ago | 0

| accepted

Answered
How can I find the index of a the characters within a string?
There are many useful functions to handle string data. Please refer to the related documentation page ( <https://jp.mathworks.co...

8 years ago | 6

Answered
Counting occurrence of matched strings in multiple columns
One possible solution would be like this. TN = {'Hex1'}; DS = {'Hex15','Hex16','Hex17','Hex18','Hex19','Hex20'}; [~,t...

8 years ago | 1

| accepted

Answered
CSVファイルの出力結果について
|csvwrite| 関数では、各行を改行文字で終了し、キャリッジリターンは付加しません。一方、Windowsのメモ帳は改行文字+キャリッジリターンを改行箇所と認識します。このため、 |csvwrite| 関数で保存したファイルをメモ帳で開くと、改行されず...

8 years ago | 3

| accepted

Answered
How do I make a 1D continuous heatmap?
How about using |imagesc| function? The following is an example. data = rand(1,100); % sample data map = interp1([0;1],[1 ...

8 years ago | 1

Answered
how do i plot this resulting modulated signal?
I would recommend checking the basic relationship between FM (Frequency Modulation) and PM (Phase Modulation) signal equations. ...

8 years ago | 0

Answered
Plot pdf from histogram - dice
|hist| function is not recommended. Please use |histogram| function instead. And by setting the 'Normalization' option, PDF c...

8 years ago | 2

| accepted

Answered
How can I map data from [min1 max1] into [min2 max2]?
You can use <https://jp.mathworks.com/help/matlab/ref/interp1.html interp1> function, like: r1 = [0 0.8]; % In...

8 years ago | 1

| accepted

Answered
How to find the lowest and highest rows in a column vector which contain a value.
idx = ~isnan(A); lowestRow = min(find(idx)); highestRow = max(find(idx));

8 years ago | 0

| accepted

Answered
Remove specific entry in a cell array
Another way to do it: idx = strcmp(animals,'dog'); animals(idx) = [];

8 years ago | 11

Answered
How to make a counter in a for loop?
You can extract every 10th row of the matrix much easier, like: % Assuming your 330x7 matrix main = rand(330,7); % Ex...

8 years ago | 1

Answered
Separate two groups of coordinate points array where one group of coordinate points are given?.
You can utilize <https://jp.mathworks.com/help/matlab/ref/ismember.html *ismember*> function, like: dataAll = rand(100,2); ...

8 years ago | 0

| accepted

Answered
等高線のラベルを指数表示にするにはどうすればいいですか?
等高線のラベルを付ける位置をマウスで指定する必要がありますが、たとえば下記のようにするとラベルを指数表示にすることができます。 x = linspace(1,3,30); y = linspace(1,3,30); [X Y] = meshg...

8 years ago | 3

| accepted

Answered
角度の求め方
少々手間ですが、MATLABの基本関数を使ったこんな方法でも対応可能です。 % atan2 で求めた theta の値から -pi/2 theta = theta - pi/2; % [-pi, pi] の範囲に調整 theta...

8 years ago | 3

Answered
How to organize a new matrix like matrix B ?
Assuming your data A is stored in table format, I believe one possible solution would be like this. % Your data stored in t...

8 years ago | 0

Answered
saving results as a table
I think the code becomes like this. N = length(myFiles); baseFileName = cell(N,1); result1 = zeros(N,1); result2 = zeros...

8 years ago | 0

Answered
colors in surf according to values
You can control surface color by setting color value, like the following. More details can be found in help page of <https://jp....

8 years ago | 0

| accepted

Answered
Convert a string containing a fraction into a number in a fraction format
if your string is always '(numbers)/(numbers)' format, the numerator and denominator of the fraction can be extracted by using |...

8 years ago | 1

Answered
split training data and testing data
I would recommend using cvpartition, like: % Sample data (54000 x 10) data = rand(54000,10); % Cross varidation (train: 70%...

8 years ago | 25

| accepted

Answered
How to split a numrical-charcater String
You can separate it by using |regexp| function, like: strAll = "R88L1R607L10R1293"; strNum = regexp(strAll,'\d+','matc...

8 years ago | 1

Answered
Plot on x and y axes (pair)
The solution would be like: % Assuming your data (2-by-28) data = rand(2,28); % Set x and y x = data(1,:); y = data...

8 years ago | 0

Answered
整数値に変換したい
例えば変数 x の値が 1.000497e+02 とすると、floor(x), ceil(x), round(x) などで整数値にすることができます(それぞれ床関数、天井関数、および最も近い整数を返す関数です)。

8 years ago | 0

| accepted

Answered
Calculate the size of the smallest rice grain in the image.
Here is another try: % Read the image I = imread('ricesam2.jpg'); Igray = rgb2gray(I); % Extract target regions BW ...

8 years ago | 2

Load more