フィルターのクリア

How can I do the next iteration?

1 回表示 (過去 30 日間)
muhammad muda
muhammad muda 2019 年 5 月 22 日
コメント済み: muhammad muda 2019 年 5 月 22 日
Hi,
My coding is basically on clustering four dimensional data. I have 4x4 matrix and I am computing the distance between the rows. You may see them in the coding.
But how can I repeat the whole process again? I mean with the new value of Mmax and Mmin.
The second question is, as in my first comment in the coding.
Thank you!

採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 5 月 22 日
編集済み: KALYAN ACHARJYA 2019 年 5 月 22 日
But how can I repeat the whole process again? I mean with the new value of Mmax and Mmin.
clc;
n= any number (how many times you want to repeat)
for i=1:n
Mmax=input('Enter new M array');
%% Your code start from
Mmin=Mmax
......
.....
end
Please note that, after that its having multiple for loops, whcih may increse computation time.
Another way defined Mmax with cell array, where you can defined multtiple Mmax and call individually Mmax{1}, Mmax{2}.....
  1 件のコメント
muhammad muda
muhammad muda 2019 年 5 月 22 日
Thank you Kalyan for your help.
By the way do you hve any idea about my 2nd question, regarding the for loop (i and j). Actually I only need to compute the difference between row 1 and 2, row 1 and 3, row 1 and 4, then row 2 and 3, 2 and 4 and so on. But the one that I did is computing all rows including the diagonal and repeating (1 and 2, and 2 and 1).
How to make it more efficient?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by