Hi all,
Sorry for the very naïve question, I hope one of you could help,
maybe there's a very simple solution to my problem.
I need to run a very simple `for' loop:
for n=2:70;
topleftx(n)=(topleftx(n-1))+
((largeurfixloc*0.028039052+(((topleftx(n-1))-topleftx(1))
*0.028039052)*0.046)*35.66454331)/2;
largeur(n)=(largeurfixloc*0.028039052+(((topleftx(n-
1))-topleftx1)*0.028039052)*0.046)*35.66454331;
hauteur(n)=largeur(n)*1.354166666;
toplefty(n)=toplefty(1)-((hauteur(n)-hauteurfixloc)/2);
bottomrightx(n)=topleftx(n)+largeur(n);
bottomrighty(n)=toplefty(n)+hauteur(n);
targn=SetRect(topleftx(n),toplefty(n),bottomrightx
(n),bottomrighty(n));
Screen('DrawTexture', w, texturetot ,kar(n) ,targ(n),
0);
end;
Of course it doesn't work (it's why I write this mail). It seems to
be because of kar(n) and targ(n). Indeed kar(n) are 1 line matrices
of the form kar(1)= SetRect(960,100,1008,165) for instance and
SetRect(left,top,right,bottom) is equivalent to
[left,top,right,bottom].
I've got the same problem with targ(n), these ones being some
rectangles too.
And if I understood a bit, the fact to specify a(1)=10, a(2)=20
creates a matrix a=[10, 20], so kar would be a matrix of matrices
and apparently matlab doesn't like that.
I thought to use a structure for kar but kar.n (I mean kar.'number')
is not accepted. So I'm quite stuck. Please tell me I'm very stupid
and there's a simple solution.
For the context, I need to display very quickly some letters but
the `drawtext' function is too slow (not by itself but because I
need to change the size for each letter it takes 8secs for 50
characters, not ideal for a gaze contingent paradigm). `Putimage' is
also too slow so I use a texture with all letters and I define some
rectangles for each letter then I draw the wanted rectangles in some
target rectangles of size and at the position I need.
Thanks a lot if I can help and even if you can't :)
seb
Sorry for the very naïve question, I hope one of you could help,
maybe there's a very simple solution to my problem.
I need to run a very simple `for' loop:
for n=2:70;
topleftx(n)=(topleftx(n-1))+
((largeurfixloc*0.028039052+(((topleftx(n-1))-topleftx(1))
*0.028039052)*0.046)*35.66454331)/2;
largeur(n)=(largeurfixloc*0.028039052+(((topleftx(n-
1))-topleftx1)*0.028039052)*0.046)*35.66454331;
hauteur(n)=largeur(n)*1.354166666;
toplefty(n)=toplefty(1)-((hauteur(n)-hauteurfixloc)/2);
bottomrightx(n)=topleftx(n)+largeur(n);
bottomrighty(n)=toplefty(n)+hauteur(n);
targn=SetRect(topleftx(n),toplefty(n),bottomrightx
(n),bottomrighty(n));
Screen('DrawTexture', w, texturetot ,kar(n) ,targ(n),
0);
end;
Of course it doesn't work (it's why I write this mail). It seems to
be because of kar(n) and targ(n). Indeed kar(n) are 1 line matrices
of the form kar(1)= SetRect(960,100,1008,165) for instance and
SetRect(left,top,right,bottom) is equivalent to
[left,top,right,bottom].
I've got the same problem with targ(n), these ones being some
rectangles too.
And if I understood a bit, the fact to specify a(1)=10, a(2)=20
creates a matrix a=[10, 20], so kar would be a matrix of matrices
and apparently matlab doesn't like that.
I thought to use a structure for kar but kar.n (I mean kar.'number')
is not accepted. So I'm quite stuck. Please tell me I'm very stupid
and there's a simple solution.
For the context, I need to display very quickly some letters but
the `drawtext' function is too slow (not by itself but because I
need to change the size for each letter it takes 8secs for 50
characters, not ideal for a gaze contingent paradigm). `Putimage' is
also too slow so I use a texture with all letters and I define some
rectangles for each letter then I draw the wanted rectangles in some
target rectangles of size and at the position I need.
Thanks a lot if I can help and even if you can't :)
seb