Effacer les filtres
Effacer les filtres

Changing a String in a loop for call external program command

2 vues (au cours des 30 derniers jours)
Arman Kam
Arman Kam le 30 Mai 2013
I want to execute some other program and change the address of execution in every loop, i wrote the bottom piece of code but it doesn't work with giving me this error:
couldn't read file "'Push';": no such file or directory couldn't read file "'Push';": no such file or directory couldn't read file "'Push';": no such file or directory couldn't read file "'Push';": no such file or directory couldn't read file "'Push';": no such file or directory couldn't read file "'Push';": no such file or directory couldn't read file "'Push';": no such file or directory couldn't read file "'Push';": no such file or directory couldn't read file "'Push';": no such file or directory
and the piece of code is:
clc;
clear all;
Zb=1500;
Zc=Zb*[0.75, 0.9, 1.0, 1.1, 1.2, 1.3, 1.5, 1.75, 2];
for ii=1:9
dlmwrite(['1\',num2str(ii),'\0\OpenSees\ColumnPar.tcl'], ['set Zc ',num2str(Zc(1,ii))],'delimiter','');
Push=['1\',num2str(ii),'\0\GoAll.tcl'];
!opensees 'Push';
end
I also tried system command but it didn't work!
(Note: opensees program is in the same folder of matlab file and GoAll.tcl is in another folder)

Réponses (1)

Eugene
Eugene le 30 Mai 2013
!opensees 'Push';
This will effectively look like
[]$ opensees 'Push';
in your linux/windows command line. So yes you do have to use system
>> system(sprintf('opensees %s', Push));
If this doesn't work then maybe there is something wrong with the path's that you've defined. Hope this helps.
  1 commentaire
Arman Kam
Arman Kam le 30 Mai 2013
Dear Eugene
opensees is a program that I want to call from system and run Push with it...

Connectez-vous pour commenter.

Catégories

En savoir plus sur Search Path dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by