for文にテキストボックスの値を入れてループさせる方法を教えてください。
Ältere Kommentare anzeigen

私はfor文入る前にtest_dataの内容をそれぞれ代入し、for文で1つずつ回るのではないかと考えていました。しかしこれではY(from,to)の中にいれてしまうと(from,to)すべての場所に同じ値が入ってしまうという結果になりました。
Y =
0.0400 - 1.7992i 0.0400 - 1.7992i 0.0400 - 1.7992i 0.0400 - 1.7992i
0.0400 - 1.7992i 0.0400 - 1.7992i 0.0400 - 1.7992i 0.0400 - 1.7992i
0.0400 - 1.7992i 0.0400 - 1.7992i 0.0400 - 1.7992i 0.0400 - 1.7992i
0.0400 - 1.7992i 0.0400 - 1.7992i 0.0400 - 1.7992i 0.0400 - 1.7992i
Y(3,1)の場合は本来想定している結果はfrom3,to1の場合は0になるはずなのにほかの値と同じになってしまっています。
Y =
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0400 - 1.7992i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
なので、テキストボックスから値を取り出してfor文で回す方法が知りたいです。お願いします。
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!