Borrar filtros
Borrar filtros

Changing a String in a loop for call external program command

2 visualizaciones (últimos 30 días)
Arman Kam
Arman Kam el 30 de Mayo de 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)

Respuestas (1)

Eugene
Eugene el 30 de Mayo de 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 comentario
Arman Kam
Arman Kam el 30 de Mayo de 2013
Dear Eugene
opensees is a program that I want to call from system and run Push with it...

Iniciar sesión para comentar.

Categorías

Más información sobre Search Path en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by