Array changes size every time I run the code

조회 수: 3 (최근 30일)
Vegard Iversen
Vegard Iversen 2022년 1월 20일
편집: Cris LaPierre 2022년 1월 27일
Hi,
Im using matlab online and when I am running the code, the size/dimension of the array changes so that I get another error later in the code because the array need to be of a certain size.
The txt file is a array/list of float values with the dimensions: 99600x1. I have check the files in matlab by just opening them there and the dimension is correct there.
The problem is when I am running the code under, that the size of the arrays kx,ky,kz and ecg changes. And its not the same change every time. Sometimes some of the sizes are correct.
Anyone knows what is wrong?
Here is a image of an example. The sizes varies.
This is my code (I have also tried using readtable with a csv file instead):
kx = load("accx_mat_ex.txt");
ky = load("accy_mat_ex.txt");
kz = load("accz_mat_ex.txt");
ecg = load("ecg_mat_ex.txt");
ecgN = ecg/max(ecg);
k = kx+ky+kz;
kN = k/max(k);
whos
Name Size Bytes Class Attributes ans 1x39 78 char ecg 99600x1 796800 double ecgN 99600x1 796800 double k 99600x1 796800 double kN 99600x1 796800 double kx 99600x1 796800 double ky 99600x1 796800 double kz 99600x1 796800 double
  댓글 수: 8
Vegard Iversen
Vegard Iversen 2022년 1월 27일
now it seemed to work. Dont know why because its the same files.
Vegard Iversen
Vegard Iversen 2022년 1월 27일
After waiting a bit, the same thing happened again. And have to delete and import the files again.

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

답변 (1개)

Cris LaPierre
Cris LaPierre 2022년 1월 27일
편집: Cris LaPierre 2022년 1월 27일
Please contact support to report this. Be sure to include that this is only happening in MATLAB Online.

카테고리

Help CenterFile Exchange에서 Data Import and Export에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by