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

11 ビュー (過去 30 日間)
Atif Laiche
Atif Laiche 2021 年 1 月 27 日
コメント済み: Image Analyst 2024 年 10 月 26 日
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.

回答 (1 件)

Image Analyst
Image Analyst 2021 年 1 月 28 日
Try importdata() or readmatrix(). Attach matm.txt if you still have trouble.
  6 件のコメント
munachi
munachi 2024 年 10 月 26 日
@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 2024 年 10 月 26 日
@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

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeText Files についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by