How to convert txt into mat
3 ビュー (過去 30 日間)
古いコメントを表示
I've got a problem with conversion txt into mat.
I have tried using this code:
M = csvread('C:\Users\gieni\Desktop\Dane01.txt');
save('C:\Users\gieni\Desktop\Dane01.mat',"M")
but it gives out just one collumn instead of 3 as in txt file.
One of the problems, as i expect is collums are divided only by tab(i mean ' ').
I have no clue how to make it right. Another thing, I'd like to multiply every data from first and 2nd collumn by 1.43, but i couldn't even make it work with 3 collumns, so i haven't started with it yet.
0 件のコメント
回答 (1 件)
VINAYAK LUHA
2022 年 6 月 8 日
HI,
As per Mathworks this documentation csvread is not recommended and readmatrix should be used instead.
M=readmatrix('filepath')
M(:,1:2)=M(:,1:2).*1.43
save('filepath',"M")
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Workspace Variables and MAT Files についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!