-1

I'm new to matlab programming.I have an image processing code which helps to load a mat file in it. the code accepts .mat file as input with video file in it.

 filename=('C:\Users\HP\Desktop\Folder\Image\NVR_ch2_main_cut_35-41.asf');
s=load(filename);
s=struct2cell(s);
M=double(s{1});

if (length(size(M))==4)
  M=squeeze(M(:,:,1,:));
end`

Error using load Unknown text on line number 1 of ASCII file C:\Users\HP\Desktop\Folder\Image\NVR_ch2_main_cut_35-41.asf "Seh".

zoho_deployment
  • 137
  • 2
  • 19
  • just google for your error message. that's a lot quicker than posting a low quality question here. [ask] – Piglet Mar 24 '16 at 13:33

2 Answers2

1

Just use v = VideoReader(filename) instead of the load function.

For further information: http://ch.mathworks.com/help/matlab/ref/videoreader.html

C.Colden
  • 627
  • 1
  • 8
  • 28
0

Well obviously Matlab won't read your file because it contains things load won't accept.

Does your file comply to this: (from the Matlab reference , next time you should read this)

ASCII files must contain a rectangular table of numbers, with an equal number of elements in each row. The file delimiter (the character between elements in each row) can be a blank, comma, semicolon, or tab character. The file can contain MATLAB comments (lines that begin with a percent sign, %).

http://de.mathworks.com/help/matlab/ref/load.html#responsive_offcanvas

Read your first sentence. You say you want to load a .mat file. But filename ends with .asf which is some video format if I remember correctly.

You can't feed a video file into load.

Piglet
  • 27,501
  • 3
  • 20
  • 43