Matlab - Problema con fprintf

 
Vista:

Problema con fprintf

Publicado por Daniel (1 intervención) el 14/04/2016 14:25:47
Hola:

Tengo un problema con la funcion fprintf, espero me puedan ayudar. Al generar la impresión de una tabla, esta genera una fila en blanco al final, fila la cual no necesito y debo eliminar. He indagado sobre como poder eliminarla pero no he tenido éxito.

Les adjunto el ciclo....

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
for bb=1:length(gc1)
    bbp=1:length(gc1p);
    TABLA=[Pest' TODO3(:,2:4)];
    TODO3(:,2:4)=[]; 
    SIN=isnan(TABLA)-1;
    SIN1=sum(SIN(:,2))*-1; delete=find(isnan(TABLA(:,2))); 

    [h,q]=find(isnan(TABLA)); TABLA(h,:)=[]; 
    
    tri=dir('*.mat'); tri1=num2str(tri(4,1).name);tri2=tri1(1,11);
       
    if tri2 == '1'
        cte='Sum';
    elseif tri2 == '2'
        cte='Fal';
    elseif tri2 == '3'
        cte='Wnt';
    elseif tri2 == '4';
        cte='Spr';
    end
      
        fileID = fopen(['velsont1_' num2str(gc1(bb)) '.txt'], 'w');
        fprintf(fileID, 'Profile %1s%12c\n',cte,'');
        fprintf(fileID, '%4s%12c\n', datestr(now, 'mm-dd-yyyy'),'');
        fprintf(fileID, '%4s%12c\n', datestr(now, 'HH:MMZ'),'');
        fprintf(fileID, '%4s%12c\n', [s4p(bbp,1) s4(bb,1) ':30S'],'');
        fprintf(fileID, '%4s%12c\n', [num2str(0) s4p(bbp,2) s4(bb,2) ':30W'],'');
        fprintf(fileID, '%6s%12c\n', num2str(SIN1),'');
        fprintf(fileID, '%6.0f \t %8.2f\t%8.2f \t%7.2f\n',TABLA');
        fclose(fileID);

end

muchas gracias.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder