Réponse apportée
defining a polygon area within an array
How about the following solution? % 100-by-100 sample matrix Zin = peaks(100); Zin = Zin - min(Zin(:)); % Example of polyg...

environ 6 ans il y a | 1

Réponse apportée
hwo can i do this image that shades from white at the image edges to black in the image centre
I believe you can do this more efficiently. The following is an example: % Set image size imSize = 100; % Make a left-top p...

environ 6 ans il y a | 2

Réponse apportée
How to extract specific rows & columns from a text file
Thank you for uploading an example. How about the following? % Read from text data T = readtable('Example.txt','HeaderLines',4...

environ 6 ans il y a | 1

Réponse apportée
Generate 0 and 1
Just FYI: To evaluate BER (Bit Error Rate) of digital communication system, PRBS (Pseudo Random Binary Sequence) has been commo...

environ 6 ans il y a | 0

Réponse apportée
Iterating over values in multiple arrays
How about the following? C = B'-A; C = C(:);

environ 6 ans il y a | 0

Réponse apportée
Plotting voronoi tesselations without its seeds
How about the following? % Seeds x = gallery('uniformdata',[1 10],0); y = gallery('uniformdata',[1 10],1); % Calculate Vo...

environ 6 ans il y a | 0

Réponse apportée
Finding rows that have only two unique clusters of values with a spread of +/- 1
How about using uniquetol function? The following is an example: % Sample matrix (a = 5, b = 10, c = 15 in your matrix) Z = [...

environ 6 ans il y a | 0

Réponse apportée
Animated Quiver Vector Plot
How about using a graphic handle? Here is an example: [x,y] = meshgrid(0:0.2:2,0:0.2:2); u = cos(x).*y; v = sin(x).*y; fi...

environ 6 ans il y a | 7

| A accepté

Réponse apportée
Nested loops for double summation
How about the following? % Example of 3-by-3 array n n = rand(3); % Calculate R, C, and T R = sum(n,2); C = sum(n); T = ...

environ 6 ans il y a | 1

Réponse apportée
How can I use a for loop to index a vector, average the indexed values, and store the averages in another vector when the subsets are of different lengths?
You don't need to use for-loop. How about the following? load('fluxhour.mat'); [group,hourNum] = findgroups(Hour); avgFlux...

environ 6 ans il y a | 1

| A accepté

Réponse apportée
Create vector of cell arrays of ranges from 0 to the value in each index of another vector
Like this? % Example of original cell oriCell = {6;9;3;8;2}; % Generated cell array outCell = cellfun(@(x) 0:x,oriCell,'Un...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
How to flatten and split and concatenate arrays in several files
I think the following code can do that task: By the way, your code will output 28440-by-1 (28440 = 9480 x 3), not the 3-by-9480...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
Trying to extract different numbers out of structured text
I believe 'Regular Expression' will extract the target part of string. The following is an example. % Extract target part of s...

environ 6 ans il y a | 1

| A accepté

Réponse apportée
produce all combinations of n choose k in binary
Another solution: n = 5; k = 3; A = unique(perms([zeros(1,n-k) ones(1,k)]),'rows');

environ 6 ans il y a | 0

Réponse apportée
メンバ変数に行列を持つ構造体の配列について, その行列の特定の要素を配列で平均したい
以下の方法ではいかがでしょうか? % 構造体配列からフィールド b の (1,1) 要素だけを抽出 c = arrayfun(@(x) x.b(1,1), a); % 平均値を計算 c_av = mean(c);

environ 6 ans il y a | 2

| A accepté

Réponse apportée
Creating a matrix using arrays
How about the following? XL = 96.5; dx = 0.423; n = 1:30; xstart = 0+n*dx; xend = XL-n*dx; xr = zeros(30,37); for kk = 1:...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
How do I combine strings using strjoin without spaces being introduced?
By using the second input argument of strjoin, you can control a delimiter. So the following code can concatenate strings withou...

environ 6 ans il y a | 2

| A accepté

Réponse apportée
How to label a plot in Matlab with combine label?
I believe the simple way is to separate the plot for each group and use xlabel to add 'Peaks', 'Concat', etc. The following is ...

plus de 6 ans il y a | 0

Réponse apportée
How can I use the split function with multiple delimiters?
How about using cellfun, like: % Sample cell array C = {'software_logical/forIteratorSubsystem/Out1', 'software_math/sum'}; ...

plus de 6 ans il y a | 2

Réponse apportée
how to normalize data between specific range
To normalize data to [0 1], you need to add ( ) correctly, like: normalized_data = (data-min(data))/(max(data)-min(data)); An...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
How to calculate Daily mean and monthly mean from hourly data?
I would recommend the following steps: Import the data file Arrange the data and create timetable variable Apply retime funci...

plus de 6 ans il y a | 3

| A accepté

Réponse apportée
How to detect rectangle in an image then crop it out?
How about the following? % Load the image and convert it to gray scale I = imread('image.jpeg'); Igray = rgb2gray(I); % De...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
How can I reduce periodic noises from my image? Please help
Looking at your image, periodic noise pattern appears around every 20~30 pixel. So I think the first step is to use FFT or DCT a...

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
Averaging hour value of a timetable
How about the following solution? % Create sample timetable Time = datetime(2019,1,1,0,0,0) + hours(0:239)'; Value = rand(240...

plus de 6 ans il y a | 2

Réponse apportée
Problem using for loop
How about limiting the loop from 3 to length(a)-2, like the following? Also, if your calculation process in the inner loop can ...

plus de 6 ans il y a | 0

Réponse apportée
Smooth data for slowly-sampled data
How about applying interpolation? The following is an example: % Original data time = 1:10; value = rand(1,10); % Apply i...

plus de 6 ans il y a | 0

Réponse apportée
フォルダ内のmri画像に値してアンシャープマスキングを行って,三次元配列に格納したい
forループのなかのimsharpen関数への入力引数が、char型になっているように見えます。 たとえばforループ内の2行を以下のように変更すると、いかがでしょうか? I = imread(imFiles(k).name); % 格納 s...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
Plotting 3D for three columns of data
How about using scatteredInterpolant function? The following is an example: D = xlsread('LMS.xlsx'); F = scatteredInterpola...

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
Detect the vertical dark layers in greysacale image
By applying findpeaks function (with appropriate option settings) to the average intensity profile, you can detect locations of ...

plus de 6 ans il y a | 1

Réponse apportée
Generate a diagonal matrix from the elements of another matrix
I would recommend using diag function. The following is an example: A = [1 2 3 4 5; 6 7 8 9 10]; A = A'; output = diag(...

plus de 6 ans il y a | 0

| A accepté

Charger plus