problem running multiple files

조회 수: 6 (최근 30일)
Anand Anand
Anand Anand 2011년 4월 6일
I have the inputs stored in multiple text files.Each and every text file has a matrix.The matrix from the first file has to be taken, processed and the result should be displayed.and then the second matrix and so on..When I manually input matrix from a file ,I get answer.But when I put a loop for automatically getting the matrices from the files instead of manually inputting one by one,I get the "matrix dimensions must agree" error..What is causing the problem?
  댓글 수: 1
Andrew Newell
Andrew Newell 2011년 4월 7일
It's hard to say what the problem is unless you show us the code.

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

답변 (1개)

Walter Roberson
Walter Roberson 2011년 4월 7일
You are not clearing the variables between the runs. The files have different sizes, so when you try to assign a part of the second dataset into a matrix which is currently (left over) assigned the size of the first dataset, the assignment fails.

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by