problem after new license

조회 수: 5 (최근 30일)
fatemeh abdi
fatemeh abdi 2023년 12월 7일
댓글: fatemeh abdi 2023년 12월 8일
Hello,
Matlab had a notification for updating and new license on 6 December.
After updating and receiving the new license, I could not run a script that I had run before.
I wanted to read txt file and do some calculations.
-------------
Array indices must be positive integers or logical values.
Error in untitled (line 21)
fft_out_hdl = sqrt(hexData1.Var1.^2 + hexData3.Var1.^2 + hexData4.Var1.^2)/(2.^32) ;
---------------------------
I decided to use Matlab online.
My script works fine in Matlab Online, but I had this error in the new updated version.
Please give me suggestion how to solve the error
Thank you for considering this matter.
Best regards
Fatemeh
  댓글 수: 2
Dyuman Joshi
Dyuman Joshi 2023년 12월 7일
Can you share the script, so we can reproduce the error?
It is weird though, you get that error for the line in which there is no array indexing.
There might be more information in the error message, so please share the full error message i.e. all of the red text.
fatemeh abdi
fatemeh abdi 2023년 12월 7일
편집: Walter Roberson 2023년 12월 7일
Thank you for your answer,
I shared only part of script that I had errors.
this code runs in matlab online, but doesn't run on my laptop after updating the license.
I think something is wrong in new version of matlab related to this
txt files are a column and 212217 rows.
% Define frequency axes
hexData1 = readtable('z_dataa.txt');
hexData3 = readtable('x_dataa.txt');
hexData4 = readtable('y_dataa.txt');
freq_axis1 = linspace(0, 2000, 2000); % 2KHz
xdata = hexData1.Var1.^2;
ydata = hexData3.Var1.^2;
zdata = hexData4.Var1.^2;
data_acc = sqrt(xdata + ydata + zdata);
% Plot xyz FFT
figure;
semilogy(freq_axis1, abs(fft(data_acc(1:2000) .* hamming(2000), 2000)));

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

채택된 답변

Walter Roberson
Walter Roberson 2023년 12월 7일
In your workspace you have a variable named sqrt .
You need to
clear sqrt
  댓글 수: 3
Dyuman Joshi
Dyuman Joshi 2023년 12월 8일
@fatemeh abdi, please share the output of this command -
which sqrt -all
fatemeh abdi
fatemeh abdi 2023년 12월 8일
Thank you so much, I solved the error with writting both commands.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by