Writing text from a pre-existing notpade?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello all,
I am using MATLAB to plot the results of my numerical similuations wihout the need to open the FEM software.
In the code below, test is the name of the input file that ABAQUS deals with.
Is there a way to avoid repeating the name of the input file several times?
I am thinking about writing the name in a seprate text fil. Then, we can let MATLAB read the name from the these text files?
Can we use this solution?
------
close all
clc;
clear;
S = mfilename('fullpath');
f = filesep;
ind=strfind(S,f);
S1=S(1:ind(end)-1);
cd(S1)
%above sets the path
delete('test.odb');
delete('test.lck');
pause(2) % can this pause stop the job from getting stuck?
system('abaqus job=test cpus=3 interactive' )
------------------------------
0 commentaires
Réponse acceptée
Jan
le 24 Mai 2021
myPath = fileparts(mfilename('fullpath'));
Name = 'test';
delete(fullfile(myPath, [Name, '.odb']);
delete(fullfile(myPath, [Name, '.lck']);
system(sprintf('abaqus job="%s" cpus=3 interactive', fullfile(myPath, 'test'))
It is not clear, what the pause() command should do. What is stucking where?
2 commentaires
Image Analyst
le 30 Mai 2021
You might use
recycle on % Deleted files to to recycle bin instead of completely vanishing.
and maybe they had the pause in there to make sure the file was actually deleted before the other process started to check for it. Though 2 seconds seems excessive. You might try 0.1 instead if you need it.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Startup and Shutdown 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!