Answered
Generate random numbers per second
The code for your question might be like this. But I'm not sure why this kind of code is needed... (I would be happy if you coul...

8 years ago | 1

Answered
grouping elements from a table
Assuming your table is |T|, the following code can generate what you want. [group, id] = findgroups(T.Week); func = @(p, q...

8 years ago | 1

| accepted

Answered
Plane fit (z=ax+by+c) to 3D point data
Assuming that your data is N-by-3 numeric array, say |yourData|, and each column corresponds to x, y and z, the following code c...

8 years ago | 4

| accepted

Answered
Compute the matrix of standard deviation of matrixs in cell array
If the size of all 100 images are the same (such as 51x51 pixel), you can easily obtain the std matrix with a few lines, like: ...

8 years ago | 0

Answered
How to plot each matrix in a cell in 3d plot ?
I don't think it's better to plot 100 lines in one graph... But I believe the following code would be what you want to do. I hop...

8 years ago | 3

| accepted

Answered
Using a for loop how could I export my data values in an the same Excel sheet without overwitting?
I think there are 2 ways to do this, as shown in the following. If your data size is not so big, I prefer the first one. (1) ...

8 years ago | 0

Answered
Removing like terms in a matrix
|ismember| function can do this more easily, like: A = [1 2 3 4 5 6 7 8 9]; B = [2 4 5 8 9]; idx = ismember(A,B); ...

8 years ago | 1

| accepted

Answered
How to do 2D interpolation
Looking at your data, curve fitting could be suitable to evaluate |y1| and |y2| at |x = 0.8, 8.3|. Here is the sample code to fi...

8 years ago | 2

Answered
How to extract specific rows with requirements from multiple CSV files?
Hi Ziran-san, thank you for uploading some sample csv files. Thanks to these files, I could understand the point! Based on th...

8 years ago | 0

| accepted

Answered
デジタルフィルタのボード線図
ボード線図の元となるデジタルフィルターの周波数応答は、関数 <https://jp.mathworks.com/help/signal/ref/freqz.html freqz> で出力することができます。横軸を周波数とするには、サンプリング周波数を指定す...

8 years ago | 3

Answered
how can i plot a contour plot over a imagesc?
The solution would be as follows: I think you should adjust 'LineColor' to clearly visualize your contour plot over imagesc. ...

8 years ago | 1

Answered
How to store corresponding two data to new matrix by using forloop?
I would recommend using |timetable| and |retime| function, like: % Convert data to datatable time1 = [0.82456; 0.84626; ...

8 years ago | 0

Answered
I have an array with data(1,unknown).I want to split it number of rows but row wise not column wise as reshape do
The following would be one solution. But I'm not sure what to do when length of your data is not 5N (N = 1,2,3...). % Your ...

8 years ago | 0

| accepted

Answered
Create Unique Randomsample 1000 times
Just in case, you can check the uniqueness by: % Make a variable 'a' a = zeros(1000, 50); for i =1:1000 a(i, :) ...

8 years ago | 0

Answered
how can i show the x-values on the x-axis , for example i would like that the graph shows the value of 100 and 500 in the x-axis
Please arrange |XTick| property of axes handle, like: % Sample data x = [100; 500; 1000; 5000]; data = [x, exp(-0.001...

8 years ago | 0

Answered
Subtracting Row and column vectors
I think the following would be one possible solution. By using zero-padding and transpose, I have adjusted A and B, C and D, to ...

8 years ago | 0

Answered
Plot a cell array containing n matrices on same graph but with different color for each matrix.
Here is another way. By using |cellfun|, you don't need to use for-loop. % Sample 10-by-1 cell C = cell(10,1); for kk...

8 years ago | 2

Answered
How can I compute histogram using three variable
The strait-forward way to do this will be like this (well, there should be more sophisticated way...). I hope it will be help yo...

8 years ago | 1

| accepted

Answered
Swaping data from 3 different columns in MATLAB
If my understanding is correct, the following code will achieve what you want to do. % Sample 4728x12 numeric array A = ...

9 years ago | 0

| accepted

Answered
Delete specific rows from character array
Using the regular expression, it can be done easily, like: A ={'*8da9b9e39909762fb8044bfc9b90;',... '*5da9b9e30ba870;'...

9 years ago | 0

| accepted

Answered
How to set bar beginning value?
If my understanding is correct, what you want to do would be like the following. Is it answering your question?? % Example ...

9 years ago | 4

Answered
How to plot table values?
How about using bar chart, like: % Sample data YourTable = table({'hotspot1';'hotspot2';'hotspot3'},[10;20;30],... 'V...

9 years ago | 0

Answered
How to blend image and label image
If you already have label matrix for your RGB image, the last part of the following example will help. -> <https://www.mathwo...

9 years ago | 1

| accepted

Answered
How to extract every elements with different dimension at multiple cells in efficient manner?
How about using |cellfun| and |horzcat| functions as follows. In this code, each element in cell array dd is transposed by |cel...

9 years ago | 1

Answered
I can't get the correct plot
This is due to the low sampling speed. Please try to use much higher sampling rate, like: t=linspace(-2,2,2000);

9 years ago | 0

| accepted

Answered
Element by element (xor) operation on cells.
I think |cellfun| would be suitable to this, like: load('Train&Test.mat'); Result = cell(numel(Test), numel(Train)); ...

9 years ago | 0

Answered
How to make a distribution from array
Plotting histogram and obtaining its bin counts are simply done by |histogram| and |histcounts| functions, respectively, like: ...

9 years ago | 1

Answered
When I am using A(:,9)= [ ]; for deletion, an error is shown (Matrix index is out of range for deletion.). What might the problem be?
If the size your numeric array |A| is 1x18, simply |A(9:18) = [];| will delete 9th~18th elements from the array.

9 years ago | 1

| accepted

Answered
How to find a value in matrix column and extract the another column equal to that value?
I think the code will be like: % Sample array data = randi([30,40],100,3); % Index where column-2 == 35 idx = da...

9 years ago | 1

| accepted

Answered
How to set legend marker size
How about changing the marker size of your plot? Here is an example. plot(magic(4),'o','MarkerSize',10); l = legend('a'...

9 years ago | 0

Load more