Execute *scl file f...
 

Execute *scl file from Matlab  

 

tinh nguyen
(@tinh-nguyen)
New Member
Joined: 3 weeks ago
Posts: 2
October 24, 2019 11:49 am  

I get stuck to run a Scripting Command Language file from Matlab. I am trying to read Ls- dyna results (by using "SCL") and to process it in Matlab.

Please help me! Thanks in advance.


Quote
Negative Volume
(@negativevolume)
Estimable Member Admin
Joined: 10 months ago
Posts: 120
October 24, 2019 4:54 pm  

Hi @tinh-nguyen

Have you tried using ls-prepost cfiles to script the export of ls-dyna results to something that Matlab can use like a .csv file? This is the way that I normally do it. Is this an option for you or do you want to know how to directly pull results from the results using Matlab only?


ReplyQuote
tinh nguyen
(@tinh-nguyen)
New Member
Joined: 3 weeks ago
Posts: 2
October 25, 2019 4:25 am  

Hi @negativevolume

Thanks a lot for your suggestion.

In my research, I am trying to make a program in Matlab which calls Ls-dyna for analysis. After that, this program also imports Ls-dyna results to process it. I get stuck to write a code (Matlab) to import the result data of Ls-dyna into Matlab. I have never tried using ls-prepost cfiles before, is it possible to solve it with cfiles?

Kind regard,

Tinh


ReplyQuote
Negative Volume
(@negativevolume)
Estimable Member Admin
Joined: 10 months ago
Posts: 120
October 30, 2019 12:49 pm  

@tinh-nguyen

Very cool. I'm not sure if there is any way to directly import results from a .binout / .ascii files into Matlab, but do share if you figure it out. 

Cfiles are written as an echo whenever you are working in LS-PrePost, so every action that you do in PrePost has a script based command. What I have done traditionally is go through PrePost and plot / save the data that you want to post-process as a .csv, or whatever file format you'd like, and then copy and save the resulting .cfile in your file directory to retain the commands used to plot everything. You can open and modify these .cfiles as a .txt file, they are pretty simple. 

As a test, you can then test the cfile by opening PrePost and dragging the cfile into the window and clicking start. It should run through everything you did before. Now, the use of these really comes by removing the specific paths in the .cfile for opening .binouts and save locations because by default without paths, it will look for and save files in the location of the .cfile. So you can use Matlab to copy these .cfiles to specific folders and run them which will provide you with a file that you can then open in Matlab. 

Let me know if you need more clarification / help with this. It's an extremely useful tool when post-processing multiple simulations the same way. 


ReplyQuote
Share: