Error in saving variable as txt file

조회 수: 1 (최근 30일)
Raady
Raady 2017년 3월 2일
답변: KSSV 2017년 3월 2일
I have a variable 'result' of size 170 rows and 1024 columns. I want to save this as txt file with each column separated by tab. Any ideas
path = 'E:\Data\fault\300';
s = what(path);
matfiles = s.mat;
l = numel(matfiles);
for a = 1:l
file = fullfile(path,char(matfiles(a)));
load(file);
result(:,a) = signal(1:1024);
end
save('300_faults.txt','result');
the text in the file appears to be not understandable
MATLAB 5.0 MAT-file, Platform: PCWIN64, Created on: Thu Mar 02 11:55:20 2017
xœ,Wy4Þ÷5TJdh@¨$Q!$⃣’±&copy;(¤”1d&trade;2Ï2{fÞ{<ó3ÏÓI„$c†D†Dƒ)•”äç»ÖïÞu×^÷&reg;»Îçî{ÎÞ{hhhÄž1ÓìØÂ[ëø¿±ýÿ÷4Ûhhl·€vk>ÞÂ]ÿ;Ûº¯zf³ã^; ؽ…ž8Ä`¸„CÄb6„´ƒE¾\âð|š….t¶þ.N‰ødÀ+e”‚çùÎ5gJèa¤ûµÑgrànýŠOf1ôžÉ`ã'd¦càM¶p¼ñàïÍÝ~&trade;¸]´œ?Ù-
åÇ6?Ô§â»;óÌ9xG~4~)· Éçÿ$´gf¹nx$¿–IÛ>æ)mÏ€Kg«:·gÂñ%zÑY›`8G%ämrfâõ‡‹7*qá€@ºˆL9v Ý÷¶5>3–Ìð‚¡Êw–<ذ0Kª]Õz|&copy;ø&trade;|´ùáÓbèúy¹÷{x2Èt:ŒüöˆÂ÷KZ‰ÓWJ‘îA‹ö’q%–:²ûuÐ3¤ó[ù” Sã¨(ÍgX&trade;߬—‚¸òc›ž+Uó‹ñè÷½e õ½nñak (oÐÿ6fH„NåU«Ašlìîzw5R†›/&copy;ZÄJ”Ô‹0žyIÅWf‘ný¬Ñ("P”Z#œ
ŠIòí¹fTeçÕî"Ãß¶»GCõ’!—&trade;!çBe
ð×r A¶Ñ†P´’2ÔÙ„=éfŠg^k£m!zÐ~nžöNÁo7]‡üW÷É;>ѯñ&trade;˜

채택된 답변

KSSV
KSSV 2017년 3월 2일
Try
save 300_faults.txt result -ascii

추가 답변 (0개)

카테고리

Help CenterFile 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!

Translated by