How can I write a loop, which can make the parameter "V" change with a cyclic variable "i"?
1 回表示 (過去 30 日間)
古いコメントを表示
My code is:
netlist = ['D:\1\MATLAB\mine.txt'];
code =['D:\\1\\MATLAB\\mine.asc\r\n'...
'R1 N001 0 {R}\r\n'...
'C1 N001 0 {C}\r\n'...
'V1 N001 0 {V}\r\n'...
'.tran .1\r\n'...
'.params R = 1000 C = 0.001 V = 15\r\n'...
'.backanno\r\n'...
'.end\r\n'];
fid = fopen(netlist,'w+');
fprintf(fid,code);
fid = fclose(fid);
I have to make the parameter "V" change with a cyclic variable "i". Is there any way to do that?
1 件のコメント
Ujjwal Pratik
2020 年 4 月 17 日
Hi Zhenyu ,
I am facing a similar issue.
Can you share your code to show how you used "strcat" and "num2str" within a loop.?
採用された回答
Vladimir Sovkov
2020 年 1 月 29 日
Use Matlab functions "strcat" and "num2str" within a loop.
3 件のコメント
Ujjwal Pratik
2020 年 4 月 17 日
I am facing a similar issue.
Can you share your code to show how you used "strcat" and "num2str" within a loop.?
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!