Error, Index in position 2 exceeds array bounds!!

조회 수: 3 (최근 30일)
zainab malik
zainab malik 2018년 9월 14일
댓글: Walter Roberson 2018년 11월 14일
When I start loading my text file I get this error how to resolve? the text file is attached. And I am getting this error :
Index in position 2 exceeds array bounds.
Error in damping (line 12) freq=dm(:,1);
close all
clear all
% LOAD DATA OBTAINED FROM FEA ANALYSIS load Sp.txt; dm= Sp; freq=dm(:,1); amp=dm(:,2);
  댓글 수: 1
Walter Roberson
Walter Roberson 2018년 9월 15일
Please do not close questions that have an Answer

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

채택된 답변

Adam Danz
Adam Danz 2018년 9월 14일
My bet is that dm is empty which would imply either that your Sp.txt document is empty or it's not loading correctly.
dm = [];
dm(:,1)
Index in position 2 exceeds array bounds.
  댓글 수: 7
zainab malik
zainab malik 2018년 9월 14일
Thank you sooooooo much. May be when i converted data from excel file to txt file at that time i used a wrong .txt type. Thats why it was not working I used Unicode.txt. Thanku very much :)
Walter Roberson
Walter Roberson 2018년 11월 14일
Sorry, just noticed the content of the question now. The original file is in UTF 16 Little Endian encoding.
You can use my csv2table from This Posting . You will need both files I posted there.

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

추가 답변 (0개)

카테고리

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by