# How to get the Code to loop for 500 more times and then get around 250000 Outputs? I need to desintegrate the Coordinates that I get in form eg: X-25,Y-25,PX102,34 in a Table with separate Rows for each value.

3 ビュー (過去 30 日間)
Vandit Bhayani 2020 年 5 月 5 日
コメント済み: Githin John 2020 年 5 月 18 日
posx=[-25:0.02:-15];
Daten=cell(length(posx),1);
% Daten=cell(500,1)
% posx=linspace(-25,-15,length(Daten))
for index=1:1:length(Daten)
Daten{index}=['PX',num2str(posx(index))];
end
writecell(Daten,'daten.txt')
##### 1 件のコメント表示 なし非表示 なし
Johannes Rebling 2020 年 5 月 5 日
Could you try and give a minimal example? Not sure what you are trying to do...

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

### 回答 (1 件)

Githin John 2020 年 5 月 8 日
It looks like a nested for loop may be what you need to use from what I understood of your problem. If that is not the case, do provide some more clarity as to what the 250000x1 cell array should look like or contain.
for index=1:1:length(Daten)
for j=1:length(Daten)
Daten{(index-1)*length(Daten)+j}=['PX',num2str(posx(index))];
%or something similar
end
end
##### 3 件のコメント表示 2 件の古いコメント非表示 2 件の古いコメント
Githin John 2020 年 5 月 18 日
What is the trouble you are facing when trying to run it 500 more times?
It is unclear what it is that you are tryin to achieve. If you want to run it for just 500 more times then the size of your array comes to 1000x1 right? But you said in your question that you wanted an array of size 250000x1. Do give some more clarity to this.

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

### カテゴリ

Find more on Loops and Conditional Statements in Help Center and File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by