Answered
How to do galois multiplication?
If you have the Communications System Toolbox, please try the following script. % Convert to GF(2^8) gfA = gf(hex2dec(A),8...

8 years ago | 0

| accepted

Answered
How to count number of matching pixels in two regions. Actually I want to calculate number of pixels in green region (which is indicating detected region).similarly I need to count number of pixel in white region of attached image.
Number of matching pixels in red and green region for your image can be calculated by: % Read the image I = imread('015_F_...

8 years ago | 0

| accepted

Answered
removing zeros element in row and colum
As Guillaume-san mentioned, you can't have empty element in a matrix without changing the matrix shape. But if you simply wan...

8 years ago | 0

Answered
How can I automatically extract the certain curve in a set of images?
I think the following script can extract the line you want. % Read your image and binarize it I = imread('abc57.jpg'); Ig...

8 years ago | 1

Answered
contourf関数を用いた特定の値を特定の色で塗りつぶす方法について
もし Zdata = 0 の等高線を重ね書きしたいということであれば、下記のようにして作成することができます。 あるいはご質問の内容は、Zdata <= 0 の領域を塗りつぶしたいということでしょうか?? Zdata = peaks(100...

8 years ago | 2

| accepted

Answered
How can i detect irregular shapes in an binary image?
I think one simple way is to use |regionprops| function, and tune some conditions to detect irregular shape. The following is on...

8 years ago | 0

| accepted

Answered
Calculating distance between a point and all points of a matrix
If you have Statistics and Machine Learning Toolbox, you can simply use |pdist2| to do that. Otherwise, you can also do that...

8 years ago | 2

Answered
How can KNN classify if there are more than 2 dimension
Yes, it is possible to use |fintcknn| to classify with 4 dimensional data. The following code (same as your example) can genera...

8 years ago | 0

| accepted

Answered
How to find minimum distance between two cylindrical objects from binary image?
By using |bwperim|, |regionprops| and |pdist2| functions, you can obtain the minimum distance and corresponding points on each o...

8 years ago | 0

| accepted

Answered
Operations with tables and matrix
I'm not sure why you want to make 3D matrix. By connecting all the tables using |innerjoin|, you can obtain a table which contai...

8 years ago | 0

Answered
Circle on binary image
The following example displays a blue circle whose radius and center are 50 pixel and (100,100), respectively. % 256x256 b...

8 years ago | 1

| accepted

Answered
自己相関、相互相関について
<https://jp.mathworks.com/help/signal/ref/xcorr.html *関数 xcorr のヘルプページ*> にある例が参考になると思います。 [r,lags] = xcorr(x,y) のように使うことで、相関係...

8 years ago | 2

| accepted

Answered
How to i generate monthly sequence
You don't need to use for-loop to obtain number of days for each month. The following example generates number of days per month...

8 years ago | 2

| accepted

Answered
I tried to find inner and outer diameter of an circle using this code but it didn't give me outputs images like below I've attached
In this case, you should pick up the region, that has maximum diameter, from the output of |regionprops| function. Based on your...

8 years ago | 1

| accepted

Answered
In binary image, how to convert large black pixels area into white ?
You can easily do that by using |imclearborder| function, like: BWout = ~yourBinaryImage; BWout = imclearborder(BWout); B...

8 years ago | 1

Answered
Finding a specific unknown value in an array?
Seems that what you want to do is like this ? % Sample data MedianValue = [453; 181; 92]; data = randi(100, 3,16); %...

8 years ago | 0

Answered
Find average of only directly repeating values in array
If you have the Image Processing Toolbox, the following code can do that task. % Sample data A = [1 0.1; 2 0.2; ...

8 years ago | 1

Answered
How to retime time series data every 15 minutes, or if it is not possible, to filter minutely data to 15-minutes data?
To retime your data in every 15 minutes, first you should convert your data into 'timetable,' next create datetime vector (= res...

8 years ago | 2

| accepted

Answered
How to convert a folder with multiple type of images such as PNG, GiF, JEPG,...etc into JPG and store the converted images in a folder in desktop ?
How about the following script? fileList = {'ngc6543a.jpg','corn.tif'}; for kk = 1:numel(fileList) I = imread(fil...

8 years ago | 1

| accepted

Answered
Pulse Train FFT low resolution
When using FFT, you should consider about "periodic boundary condition." In your original code, I don't think this condition was...

8 years ago | 1

| accepted

Answered
plot a partial sphere with a circular top like a bowl
I think one possible solution would be |fsurf| function. How about the following script? R = 0.1385; r1 = 0.0525; th...

8 years ago | 0

| accepted

Answered
Find optimized x1, x2, x3 for a given y.
Another solution would be to use fsolve function, like: fun = @(x) x(1)^2+2*x(1)*x(2)+x(3)^2 - 2; options = optimoptions(@...

8 years ago | 0

Answered
How to use cumsum for data in a table which is not NaN?
How about keeping position of NaN, applying cumsum with 'omitnan' option and finally putting NaN for the position, like: Va...

8 years ago | 4

Answered
How to subplot two or more multiple-plots created by different loops
Please put it just before 'plot' function, like: n = input('The value of n is:'); k = 100; X1 = linspace(-20,20,k); ...

8 years ago | 0

| accepted

Answered
How to distinguish touching and merging shapes on a binary image
Hi Dzmitry-san, Thank you for sharing your data, and sorry for my late response. Though I tried the *watershed* function f...

8 years ago | 2

| accepted

Answered
How to get the average RGB values of a given region and then Set the region to that color
Here is a straightforward script to extract the background region, calculate average RGB value and replace the foreground region...

8 years ago | 1

Answered
how can I plot a real part of an electric field
Assuming a plane wave propagating along z-axis, a real part of an Electric field can be calculated by the following code. By ...

8 years ago | 2

| accepted

Answered
i have an array like A= [ 51 22 33 56 67 78 .....] and i have one more matrix of size[1000 300] i need to remove A[] values in matrix.
I think one possible solution would be like this. A = [51 22 33 56]; B = rand(1000, 4); % Remove first A(kk) and las...

8 years ago | 0

| accepted

Answered
Removing NaN values among data
Another possible solution: A = [NaN NaN NaN NaN NaN;... NaN NaN NaN NaN NaN;... NaN 3 4 6 NaN;... NaN 4 NaN ...

8 years ago | 1

Answered
Matrix manipulation from one to another one
Here is the B = [multiple rows * multiple columns] example. B = reshape(1:64,8,8); % Create 8x8 sample matrix idx = rand...

8 years ago | 0

| accepted

Load more