フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Can somebody solve this error pleaaase?

1 回表示 (過去 30 日間)
LuS
LuS 2015 年 8 月 8 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi all,
I have been struggling (new in Matlab) since yesterday to solve persistant errors and cannot find a way to 'Make Texture' for multiple images. Here is my experiment:
I want to show a number of images, one by one, every 500 milliseconds and every image should stay on the screen for 500ms. Each image should be repeated 9 times but the whole presentation should be random. That is, I do not want to present 1 to 10 randomly and then repeat that same order. I want all images, repeated 9 or 10 times but with random presentation.
Also, I cannot figure out how to 'Make Texture' for multiple images :-( I really need that Function urgently. Can anybody tell me what is wrong with what I wrote?
Many thanks!!
function X
%Open the screen
Screen('Preference', 'SkipSyncTests', 1);
[wPtr,rect]=Screen('OpenWindow',max(Screen('Screens')), [], [0 0 500 500]);
xCenter=rect(3)/2;
yCenter=rect(4)/2;sca
%set up some vectors with our options
allFiles=dir('C:\Users\X\Desktop\MatlabTutorial\EGItest\*.jpeg');
allNames={allFiles};
images_info=dir(fullfile('C:\Users\X\Desktop\MatlabTutorial\EGItest\*.jpeg'));
numImage=length(images_info);
images=cell(numImage,1);
imagenum=1:18;
thingnum=1:9;
[IMAGENUM, THINGNUM]=ndgrid(imagenum,thingnum);
pair_specs=[IMAGENUM(:), THINGNUM(:)];
randorder=randperm(size(pair_specs,1));
rand_specs=pair_specs(randorder,:);
for K=1:numImage
images{K}=imread(fullfile('C:\Users\X\Desktop\MatlabTutorial\EGItest\*.jpeg', images_info.name));
end
T=repmat(1:numImage, 1, 9);
Trand=T(randperm(length(T)));
for K=1:length(Trand)
ourTexture=Screen('MakeTexture', wPtr, );
Screen('DrawTexture', wPtr, ourTexture,[], ourRect);
stimTime=Screen('Flip', wPtr);
imtool(images{k});
repelem(v,3);
end
%Get size of image (all images the same size in this example)
%imageHeight
%imageWidth
%colorChannels
[imageHeight, imageWidth,colorChannels]=size(0);
%Set up left and right picture locations
gap=100; %distance of pics from center
leftRect=[xCenter-gap-imageWidth, yCenter-imageHeight/2, xCenter+imageHeight/2];
rightRect=[xCenter+gap, yCenter-imageHeight/2, xCenter+gap+imageWidth, yCenter+imageHeight/2];
%loop for 180 trials
for trial=1:180
file_name=dir(strcat('C:\Users\X\Desktop\MatlabTutorial\EGItest\*.jpeg'));
end
%pick a random number 1 or 2
randTextureNum=randi(2);
%pick a random number 1 or 2
randRectNum=randi(2);
end

回答 (1 件)

Walter Roberson
Walter Roberson 2015 年 8 月 8 日
  1 件のコメント
Walter Roberson
Walter Roberson 2015 年 8 月 13 日
Screen() is not a Mathworks routine. It could do anything for all we know about it. We have no idea what it does or how it does it or what it is intended to do. You will need to either supply the code for it that you wrote or else tell us where to find the code.
I am not going to try to debug the rest of your code until you fix the file handling as I indicated needed to be done in one of your other threads.

この質問は閉じられています。

タグ

タグが未入力です。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by