How can i import mass and stiffness matrices (MatK and MatK .TXT) to Matlab ?

9 vues (au cours des 30 derniers jours)
Atif Laiche
Atif Laiche le 27 Jan 2021
Commenté : Image Analyst le 26 Oct 2024
Hi every one, i'm very new in MATLAB, i extracted mass and stiffness matrices from ansys workbench text files, and i want to import them to MATLAB.
load matm.txt
Error using load
Unable to read file 'matm.txt'. Input must be a MAT-file or an ASCII file containing numeric
data with same number of columns in each row.

Réponses (1)

Image Analyst
Image Analyst le 28 Jan 2021
Try importdata() or readmatrix(). Attach matm.txt if you still have trouble.
  6 commentaires
munachi Egbo
munachi Egbo le 26 Oct 2024
@Image Analyst Please can explain how to use the attach matm.txt in this reference.
importdata(attach 'matlab.txt'); % Please just write it out it. Thank you.
Image Analyst
Image Analyst le 26 Oct 2024
@munachi Egbo to import matm.txt with importdata you'd do
data = import('matm.txt');
For more info:
help importdata
importdata - Load data from file This MATLAB function loads data into array A. Syntax A = importdata(filename) A = importdata('-pastespecial') A = importdata(___,delimiterIn) A = importdata(___,delimiterIn,headerlinesIn) [A,delimiterOut,headerlinesOut] = importdata(___) Input Arguments filename - Name and extension of file to import character vector | string scalar delimiterIn - Column separator character character vector | string scalar headerlinesIn - Number of text header lines in ASCII file nonnegative scalar integer Output Arguments A - Data from the file matrix | multidimensional array | scalar structure array delimiterOut - Detected column separator in the input ASCII file character vector headerlinesOut - Detected number of text header lines in the input ASCII file integer Examples openExample('matlab/ImportandDisplayanImageExample') web /MATLAB/help/matlab/ref/importdata.html#btldf1f-1 web /MATLAB/help/matlab/ref/importdata.html#btmah78 web /MATLAB/help/matlab/ref/importdata.html#btmchli-1 See also readmatrix, readcell, readvars, load, save, textscan, imread, readtable, Import Tool Introduced in MATLAB before R2006a Documentation for importdata doc importdata

Connectez-vous pour commenter.

Catégories

En savoir plus sur Data Import and Analysis dans Help Center et File Exchange

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by