Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
Need some help with writing date from txt and formating them in same format to another txt file.
    2 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
I have been experiencing some troubles in reading the values that are on the file and formating appropriately then writing them on the another txt file.tThat is what i am trying to do . there is a panel1.txt which has the coordinates of airfoil side by side. QF will be my variable it should store the coordinates in 19 by 2 matrix(since 19 columns of input stored in panel1) as it is already inputting on the panel1 txt file. When i run this script in seperate it gives "Assignment has more non-singleton rhs dimensions than non-singleton subscripts" type error sometimes different i am not much familiar with matlab so dont understand the problem and when it reads the files i want to write them as the same format to another file in this case panel2.txt . I am not even sure about the type of the QF variable which should be 3 dimensional matrix but matlab not seem to like it i am actually converting some codes from fortran which is my main coding language. Can someone help me about this conversion any help is appreciated. I attached the panel1.txt. If anybody knows fortran i can send the code i try to convert.
    fileID1 = fopen('panel1.txt','r');
  fileID2 = fopen('panel2.txt','r');
   fprintf(fileID2,'     AIRFOIL COORDINATES \n     =================== \n    X Z')                          
 IB1=fscanf(fileID1,'%3d'); 
       for  I=1: IB1
            QF(I,1,1)=fscanf(fileID1,'%f %f'); 
            QF(I,1,3)=fscanf(fileID1,'%f %f'); 
            fprintf(fileID2,'%f %f',QF(I,1,1),QF(I,1,3)); 
       end %10
   fclose(fileID11);
   fclose(fileID12);
2 comentarios
  Azzi Abdelmalek
      
      
 el 20 de Ag. de 2016
				You can make your question brief and clear. Tell how your data are stored in your text file, you can post a short example.
Respuestas (0)
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!