Prev: dsolve error
Next: Matlab code for lid-driven cavity
From: Kay on 19 Apr 2007 19:45 I need to create a piece of code in Matlab that will take input a text file with some values such as 2/2, 1/2, 1/1, and 0/0 and converts all the 2/2 to 2, 1/2 to 1, 1/1 to 0 and 0/0 to -1 and outputs this data to another text file. Can somebody please help me out? Karim
From: Joseph on 23 Apr 2007 17:50 a = '1/2'; b = find(a=='/'); num(:,1) = str2num(a(1:b-1)); num(:,2) = str2num(a(b+1:end)); This code will allow for multiple-digit returns everything else can be solved with save or fwrite cheers Kay wrote: > > > I need to create a piece of code in Matlab that will take input a > text file with some values such as 2/2, 1/2, 1/1, and 0/0 and > converts all the 2/2 to 2, 1/2 to 1, 1/1 to 0 and 0/0 to -1 and > outputs this data to another text file. > > Can somebody please help me out? > > Karim
|
Pages: 1 Prev: dsolve error Next: Matlab code for lid-driven cavity |