Answered
Use a vector a range of input values for a function
I think the following is what you want to do. Just FYI, I would recommend replacing '3.14' by |pi| for more precise calculation....

8 years ago | 0

| accepted

Answered
How to create a plot with this values
I believe you can avoid for-loop by vectorizing variables. Assuming h1, hT2s, hT3 and hT4s are constant value, you can calculate...

8 years ago | 0

Answered
Adding dots to a box-plot
Since the XTick of the 1st, 2nd... box plots are 1, 2..., x = 0.3 might be too small to display on the graph. If you adjust (x,y...

8 years ago | 0

Answered
How to do Delaunay Triangulation and return an adjacency matrix?
By using the output variable of |delaunay| function, you can create adjacency matrix like: % N: Number of points N = 8; ...

8 years ago | 2

Answered
ループ、計算したデータを一個一個にtxt書き出す
できれば、forループで計算したデータすべてを保存できるだけの配列をあらかじめ用意しておいて、forループが完了した後、一括でまとめてファイル出力をすることをお勧めします。 もしどうしても1列ごとに出力する必要がある場合、 |dlmwrite| 関数...

8 years ago | 3

| accepted

Answered
How to plot a spherical cap in 2-D
I think |fsurf| function would be help, like: funx = @(theta,phi) sin(theta).*cos(phi); funy = @(theta,phi) sin(theta).*si...

8 years ago | 1

Answered
insert row into table
How about concatenate 2 tables, and then sort it? Here is an example: % Initial table T = table(... [0;120;160;200],....

8 years ago | 3

Answered
3D plot an ellipsoid?
How about using a |fsurf| function, like: a = 2; b = 1; funx = @(theta,phi) a*cos(theta).*cos(phi); funy = @(theta,p...

8 years ago | 2

| accepted

Answered
How to skip over zero values in an array?
You can also do that by another way, like: idx = abs(dialsound) < eps; arrayout = dialsound(~idx);

8 years ago | 0

| accepted

Answered
How can I get matlab to draw lines between points?
To draw pentagram, the latter half of your script should be: angle = linspace(0,2*pi,6); x = r*sin(angle); y = r*cos(angl...

8 years ago | 1

| accepted

Answered
How to For Loop to merge two images each year in Matlab?
Assuming all your images are '****.png' with the same size and stored in the current folder, the following script can do it. ...

8 years ago | 0

Answered
why can't I see line in the plot?
You should slightly modify the second line by: y= 0.6*(x.^3).*(exp(-0.47*x))+1.5*(x.^2).*(exp(-0.6*x)); Then you can obt...

8 years ago | 1

Answered
Why my axis have wrong startung date?
I think the following line in your code is causing this problem. set(gca,'XTick',linspace(L(1),L(2),NumTicks)) You shoul...

8 years ago | 0

Answered
Gaussian distribution with randn
If you want to generate Gaussian distribution with the given mean and variance (not std), and then extract the values in [min ma...

8 years ago | 2

| accepted

Answered
How to find the internal and external radius of a ring using matlab image processing toolbox
By measuring the 'equivalent diameter' for each region, you can obtain the inner and outer radius. Here is an example. % Re...

8 years ago | 0

| accepted

Answered
how can i vectorize this loop?
Seems that you would like to do |circshift| ? Your 'y = ShiftLeft(x)' seems equivalent to 'y = circshift(x,1)', like: x ...

8 years ago | 0

Answered
Importing excel data containing previously defined variables
I think the script like this can do what you want. % Read excel file [A,~,raw] = xlsread('yourExcel.xlsx'); % Variabl...

8 years ago | 0

| accepted

Answered
How do I read only numerical data and ignore other text from input file?
Is this what you would like to do? % After textscan C = {'0, 1 !t0, y0';... '1 !tf';... '0.1 !h';... '1 !Eu...

8 years ago | 0

Answered
How to edit a text file using matlab?
Here is an another way to do that without using for-loop. % After textscan C = {'1 1 4 0 6';'1 2 9 5 6'}; % Replace s...

8 years ago | 0

Answered
how can i plot the function m(t) in matalb?
How about this? % Calculate m(t) between time = 0~0.08 time = 0:0.001:0.08; y = arrayfun(@mt, time); % Plot m(t) ...

8 years ago | 0

Answered
Detect longest line in an image
Hi Mihael-san, Thank you for sharing your picture. By detecting the bottom edge of the center black rectangle, I think you ca...

8 years ago | 1

Answered
Count dots on dice wich are connected
Since distance between dots on a same dice is shorter than that on the different dice, distance-based clustering technique may b...

8 years ago | 2

Answered
Finding X value with known Y value on plot
One possible way to find the threshold-crossing points is interpolating the data by spline function and find the crossing points...

8 years ago | 1

Answered
why does `imfill` fill the whole image?
You should delete light area connected to image border before applying |imfill|. By using |imclearborder| function before apply...

8 years ago | 2

| accepted

Answered
I want to Segment highlighted round area from given below image using matlab code. Can anyone Help ?
Checking the gray-scale level of the bright area, it was found to be >~224, as shown below. <</matlabcentral/answers/uploaded...

8 years ago | 1

Answered
fitrgp initial data of kernelparameters and sigma
二乗指数カーネルの場合、KernelParameters は2行1列のベクトル、Sigmaは正のスカラー値として与えることができます。例えば、(x, y) のデータ点群から y = f(x) の回帰モデルを作成する場合、 gprMdl = fit...

8 years ago | 2

Answered
Color-Based Segmentation Using the L*a*b* Color Space
Looking at your image, there are obviously 4 colors --- blue, green, red and dark brown (=background). So I believe <https://jp....

8 years ago | 0

| accepted

Answered
RMSの算出方法についての質問です。200Hzでサンプリングした加速度波形を100Hz毎のサイズでRMSを算出したいのですが、どのようにすればよいでしょうか?
サンプリング周波数 200Hz で取得された時系列データをもとに、100ms毎のRMS値を計算したいということでしょうか? もしそうであれば、時系列データの配列をもとに 0.1[s]/(1/200[Hz]) = 20 サンプル毎のRMSを計算する、という手...

8 years ago | 3

| accepted

Answered
Welchのパワースペクトル密度推定の算出方法について
オーバーラップのサンプル点数やフーリエ変換のサンプル点数を特に指定する必要がなければ、以下のようにして1024 pointのHamming Windowを使用したパワースペクトル密度(横軸:周波数、縦軸:スペクトル密度)を作成することができます。 ...

8 years ago | 1

| accepted

Answered
Find cell containing part of a string
If your MATLAB is R2016b or later version, you can use |contains| function, like: idx = cellfun(@(x) contains(stringToCheck...

8 years ago | 2

Load more