| | |
Matlab loading file problem
Please support our Legacy and Other Languages advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jun 2006
Posts: 9
Reputation:
Solved Threads: 0
Hi to all,
I want to ask how can I load files with for loop?
My file names are like D1,D2,D3 and so on..
THen how do i assign the filename variable so that Matlab recognises it?
I tried using this code but it seemed that Matlab recognised the a as the teh word "D1" rather than the file D1 and it says ndex exceeds matrix dimensions
for n=1:20
% read data file
load (['C:\weatherdata\D',num2str(n),'.txt']);
a = ['D',num2str(n)]
lati = a(5,: );
Thanks
I want to ask how can I load files with for loop?
My file names are like D1,D2,D3 and so on..
THen how do i assign the filename variable so that Matlab recognises it?
I tried using this code but it seemed that Matlab recognised the a as the teh word "D1" rather than the file D1 and it says ndex exceeds matrix dimensions
for n=1:20
% read data file
load (['C:\weatherdata\D',num2str(n),'.txt']);
a = ['D',num2str(n)]
lati = a(5,: );
Thanks
Last edited by jubleebow; Jul 28th, 2006 at 7:31 am.
![]() |
Similar Threads
- New member with a system file problem... (Windows NT / 2000 / XP)
- C++ linking problem (C++)
- Basic File I/O problem (C++)
- problem in reading a file (Shell Scripting)
- "cannot resolve symbol"problem (Java)
- can't set paging file values (Windows NT / 2000 / XP)
- Building D.L.L in Matlab (Visual Basic 4 / 5 / 6)
Other Threads in the Legacy and Other Languages Forum
- Previous Thread: ifft is this logically correct
- Next Thread: Qbasic Text book
| Thread Tools | Search this Thread |






