Combination of DATA in arrange manner
How about the following? % Create D and E D = -0.02+0.0001*(0:70); E = 160:200; % Apply meshgrid function [xg, yg] = mesh...

1 year ago | 1

| accepted

Find out the cell index from matric values
How about using histcount2 ? The following is an example: % Sample data A = [... 0.7, 0.1;... 0.1, 0.2;... 0.8, 0.6;...

1 year ago | 0

| accepted

Best way to get rid of/ prevent function from creating complex numbers?

1 year ago | 0

Create all permutations of 1x13 vector used for Leave-p-out Cross-Validation
How about the following? Though this generates 78x11 (instead of 13x78 which you expected), the result contains all possible co...

1 year ago | 0

return value of [ ] for an 'if' or 'for' function
How about the following? function output = yourFunction(input) if isempty(input) output = 'unknown'; elseif isa(input,'n...

1 year ago | 0

| accepted

How to speed up my code?
Avoiding for-loop will enhance computational efficiency. For example, the first for-loop: for i=1:n2 K(:,:,i)=M(:,:,i); en...

1 year ago | 0

| accepted

How to use 'mkdir' command to make folders labelled as 1, 2, 3 till 100 using for loop in matlab code?
How about the following? rootFolder = 'E:\P2'; for kk = 1:100 subFolder = num2str(kk); folderPath = fullfile(rootFolde...

1 year ago | 0

| accepted

How to calculate the number from a database
How about the following? List = arrayfun(@(x) x.country, TV,... 'UniformOutput', false); [Group, Country] = findgroups(Li...

2 years ago | 1

| accepted

find 関数を使う下記の方法ではいかがでしょうか？ % A の2列目が >= 1 となる最初の行番号を pt として取得 pt = find(A(:,2) >= 1, 1); % pt行目から最後までの行を配列 B として保存 B = A(p...

2 years ago | 1

Assign number to certain value in cell
How about using ismember function? Like: % Sample cell arrays A = {'As', 'C', 'H', 'N'}; B = {'As', 'As', 'N', 'N', 'H', 'H',...

2 years ago | 0

replacing numbers with alphabets/letters in a matrix
One possible straight-forward solution would be like this: M = readmatrix('testfile_0.50.xlsx'); C = cell(size(M)); idx = i...

2 years ago | 0

| accepted

Assign partnames to two different tables with measurement datas
I wouold recommend using innerjoin or outerjoin functions for this kind of task.

2 years ago | 0

Is there an alternative to eval in a struct?
I believe it's better to arrange the data as a table rather than the deeply nested structure. How about the following? subject ...

2 years ago | 1

Need help asking for an input sentence
To input a text, you should use 's' option, like: N = input('what is N?: ') A = input('give me a sentence!: ','s');

2 years ago | 0

MATLABのウィンドウの長さとは、何を意味しているのでしょうか。

2 years ago | 0

| accepted

Storage results in an array
Instead of uisng for-loop, you can do this task by vectorizing, like: x = [2, 3, 4, 5, 6]; y = x + 2; idx = x > 4; y(idx) = ...

2 years ago | 0

3次元から2次元に形状変換

2 years ago | 1

| accepted

2 years ago | 0

| accepted

How can I write a csv file by row or by column
How about the following? % Sample data (1-by-3 cell array) output = {... uint8(randi([0 255],100,1)),... uint8(randi([0 ...

2 years ago | 0

figure を作成する際にあらかじめ figure ハンドルを取得しておくことで、gcf を使わなくてもそれぞれの figure を操作可能です。例えば、以下のようにすれば 2 つの figure に対するハンドル hFig1, hFig2 を取得できま...

2 years ago | 1

| accepted

Excluding types of extension files on a loop
You can do that more effective way by using wild card character "*", like: imgFolder = pwd; % <- set to your image folder path ...

2 years ago | 2

Tableからデータを抽出する方法

2 years ago | 0

how to generate and cover all the possible arrays using two enties
Another possible solution: [p,q,w,s] = ndgrid({'H','C'}); A = [p(:),q(:),w(:),s(:)]; disp(A)

2 years ago | 0

イメージの行列の計算について

2 years ago | 2

| accepted

how to convert bmp image to Bpg
Unfortunately, currently BPG image format is not supported. As a workaround, how about installing bpgenc from the following sit...

2 years ago | 0

いろいろな解決法があるかと思いますが、fminsearch を使って円をあらわす式の係数を推定するのはいかがでしょうか？ 以下はその一例です。 x = [x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12]; y = [y1...

2 years ago | 1

| accepted

Bit Error Rate (BER) performance of different digital modulation schemes such as Binary Phase Shift Keying (BPSK),
I believe the following documentation page would be help: https://jp.mathworks.com/help/comm/ref/berawgn.html

2 years ago | 1

Add missing numbers of 0's and 1's in an array
How about the following? % Sample data x = [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0]; % Calculate run...

2 years ago | 0