Prev: How to extract pixel values of a colored image into an arrayand then to convert the array into an image
Next: binary image features
From: Walter Roberson on 17 Jun 2010 17:05 Braden wrote: > Walter Roberson <roberson(a)hushmail.com> wrote in message >> > I also need a bit of direction on the appending >> > process. Any suggestions? >> horzcat() or vertcat() perhaps; consider using cell arrays if you need >> to be able to access the data for a particular file as a group. > How would I go about setting up a cell array to store my data? MyLog = cell(NumIterations,1); for K = 1 : NumIterations MyLog{K} = sprintf('Simple sample log for iteration #%d', K); end
From: Braden on 23 Jun 2010 18:18 I have an issue on the same topic and I can't get past it. This will be a quick one if anyone can help. My code is to open a csv file, write it to a different csv with a specified name. Eventually the next file in sequence will be appended to it but that is further down the line. I need to make fprintf skip to the next row to print the next tline - otherwise it is one never ending row. I have tried using '\n' where the format type is specified but instead of writing anything it just clears the line. [fileName,pathName] = uigetfile('*.csv'); fid = fopen(fileName); A=fopen('Halkirk1.csv', 'w+'); tline = fgetl(fid); while ischar(tline) fprintf(A,tline); tline = fgetl(fid); end fclose(fid); Thanks for the help.
From: Braden on 25 Jun 2010 13:01
"Braden " <braden.rooke(a)gmail.com> wrote in message <hvu16s$jl3$1(a)fred.mathworks.com>... > I have an issue on the same topic and I can't get past it. This will be a quick one if anyone can help. My code is to open a csv file, write it to a different csv with a specified name. Eventually the next file in sequence will be appended to it but that is further down the line. > > I need to make fprintf skip to the next row to print the next tline - otherwise it is one never ending row. I have tried using '\n' where the format type is specified but instead of writing anything it just clears the line. > > [fileName,pathName] = uigetfile('*.csv'); > > fid = fopen(fileName); > A=fopen('Halkirk1.csv', 'w+'); > > tline = fgetl(fid); > > while ischar(tline) > fprintf(A,tline); > tline = fgetl(fid); > end > > fclose(fid); > > Thanks for the help. Someone has to have a quick tip for this eh? Any help would be greatly appreciated. |