Warning: Attempt to write an unsupported data type to an ASCII file. I am trying to save a matrix to an ascii file but it keep throwing this error

조회 수: 17 (최근 30일)
I am writing a code for a homework assignment that does a variety of things. One of the thing it has to do is load antennaData.mat and manipulate the theta and rho vector and then concatenate them into a matrix. Then, I have to save the matrix to an ascii file. All is well and good but when I try to save the matrix I get the error "Warning: Attempt to write an unsupported data type to an ASCII file"
This is the sample of my code that throws the error. I looked at other question regarding similar issues but those errors were the resulkts of matrices not using numberic elements. But my matrix has numeric values as it should. So I'm very lost as to why its throwing an error.
load antennaData.mat
theta = [theta(1:end); 2*pi + theta(2:end)];
rho = [rho(1:end); 2*pi + rho(2:end)];
M = [theta, rho];
save 'M' '-ASCII';

채택된 답변

Cris LaPierre
Cris LaPierre 2021년 10월 9일
I'm not able to reproduce your error, but try following this example. I would code this as
save M.txt M -ascii
% or
save('M.txt', 'M', '-ascii')
  댓글 수: 3

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by