It is showing error in the program command window

1 Ansicht (letzte 30 Tage)
VIJAY KUMAR
VIJAY KUMAR am 8 Apr. 2016
Kommentiert: Walter Roberson am 9 Apr. 2016
I am showing that error in the following in red color
Conversion to logical from matlab.graphics.chart.primitive.Line is not possible.
Error in CleanData/CloseCleanedData (line 97) if pl(j)
Error using uiwait (line 81) Error while evaluating Figure CloseRequestFcn

Antworten (1)

VIJAY KUMAR
VIJAY KUMAR am 8 Apr. 2016
Bearbeitet: Walter Roberson am 8 Apr. 2016
clearvars -except faceMapsSave5 faceMapsSave7 faceMapsSave9;
% close all;
pathSetup();
Partition is preferably set the main folder on the drive used.
%partition = 'C:\Data\Users\Alexander\Movies\Besira\November 27\';
partition = 'C:\Data\Users\Alexander\Movies\Besira\';
[fileName, filePath] = uigetfile([partition '*.mat'],'Choose file');
stepperData = load([filePath '..\cam_' fileName(6:end-4) '.txt']);
bsIndex = find(filePath == '\' | filePath == '/');
saveName = filePath(bsIndex(end-3)+1:bsIndex(end-1)-1);
bsIndex = find(saveName =='\' | saveName == '/');
saveName(bsIndex) = '_';
saveName(saveName == '%') = 'p'; % Can't save as .pdf with '%' in file name.
saveName(saveName == ' ') = '_';
%%Error calc option
errorbars = 0; % errorbar = 0 draws two lines with 1 resp std:s
compensateErrorForWidth = 1;
closeAllWindows = 0; %Closes all plots when closing one, good to use when resaving plots
%%Name saved figures and data
savePathData = 'C:\Data\Users\Alexander\Movies\SavedPlotsAndData\data\';
savePathPlot = 'C:\Data\Users\Alexander\Movies\SavedPlotsAndData\plots\';
savePathAnnot= 'C:\Data\Users\Alexander\Movies\SavedPlotsAndData\annotations\';
savePathRod = 'C:\Data\Users\Alexander\Movies\SavedPlotsAndData\rods\';
%%replot all data in data folder
% files = dir([savePathData '*.mat']);
% nrOfFiles = length(files);
% errorFiles = {};
% %%
% for i = 1:nrOfFiles
% saveName = files(i).name(1:end-4);
if ~exist('faceMapsSave5','var')
faceMapsSave5 = load('FaceMapsLambda5.mat');
faceMapsSave5 = faceMapsSave5.L5;
faceMapsSave7 = load('FaceMapsLambda7.mat');
faceMapsSave7 = faceMapsSave7.L7;
faceMapsSave9 = load('FaceMapsLambda9.mat');
faceMapsSave9 = faceMapsSave9.L9;
end
facemaps = {faceMapsSave5,faceMapsSave7,faceMapsSave9};
if exist([savePathData saveName '.mat'],'file')
fuss = load([savePathData saveName '.mat']);
saveStruct = fuss.saveStruct;
saveStruct.saveName = saveName;
lambda = saveStruct.rodLength/3; %3 is the diameter of the rod
[~,bestMatchLambda] = min(abs([5 7 9] - lambda));
%
facemapMatch = facemaps{bestMatchLambda};
saveStruct.bestMatchLambda = bestMatchLambda;
saveStruct = FitExpToTheory(saveStruct,facemapMatch, 1);
save([savePathData saveName '.mat'],'saveStruct')
else
%%Load data
fuss = load([filePath fileName]);
data = fuss.data;
extraData =fuss.extraData;
currentRange = [1, length(data(:,1))];
loadedStruct = extractData(data,extraData,currentRange,0,1,compensateErrorForWidth);
loadedStruct2 = extractData(data,extraData,currentRange,0,0,compensateErrorForWidth);
frames = load([filePath 'frames.mat']);
%%Data needed from the extracted data
saveStruct = struct();
saveStruct.n_x = loadedStruct.n_x;
saveStruct.n_z = loadedStruct.n_z;
saveStruct.XDistanceCons = loadedStruct.XDistance;
saveStruct.XDistance = loadedStruct2.XDistance;
saveStruct.XFrames = loadedStruct.XFrames;
saveStruct.stretchData = extraData.stretchData;
saveStruct.flowAngle = extraData.FlowAngle;
saveStruct.P_M_Start = mean(extraData.x);
temp = stepperData(1,3)*1e-3;
saveStruct.X0 = stepperData(1,2)*1e-3;
saveStruct.Y0 = temp - saveStruct.flowAngle*saveStruct.X0;
saveStruct.rodLength = loadedStruct.rodLength;
saveStruct.frames = frames;
saveStruct.saveName = saveName;
saveStruct.YPos = loadedStruct.YPos;
saveStruct.XTime = loadedStruct.XTime;
saveStruct.a = loadedStruct.a;
saveStruct.b = loadedStruct.b;
saveStruct.loadedStruct = loadedStruct;
saveStruct.saved = 0;
lambda = saveStruct.rodLength/3; %3 is the diameter of the rod
[~,bestMatchLambda] = min(abs([5 7 9] - lambda));
facemapMatch = facemaps{bestMatchLambda};
saveStruct.bestMatchLambda = bestMatchLambda;
%Exstract, structure and clean data
saveStruct = SortOutData(saveStruct);
%Pair stretches for reversals
% saveStruct = PairStretches(saveStruct);
%Select a picture of the particle
saveStruct = SelectFrame(frames,saveStruct);
% Find Nx = 0
indices = FindNx0(saveStruct.stretchesNX);
saveStruct = FindDeltaNz(indices,saveStruct); %First collumn nz, 2nd deltaNz
saveStruct = FloatOrSink(indices,saveStruct);
%Fit values to a theoretical orbit
saveStruct = FitExpToTheory(saveStruct,facemapMatch,1);
saveStruct = ErrorTest(saveStruct,compensateErrorForWidth);
save([savePathData saveName '.mat'],'saveStruct')
end
try
% indices = FindNx0(saveStruct.stretchesNX);
% saveStruct = FindDeltaNz(indices,saveStruct); %First collumn nz, 2nd deltaNz
% saveStruct = FloatOrSink(indices,saveStruct);
fuss = load([filePath fileName]);
data = fuss.data;
extraData =fuss.extraData;
currentRange = [1, length(data(:,1))];
loadedStruct = extractData(data,extraData,currentRange,0,1,compensateErrorForWidth);
loadedStruct2 = extractData(data,extraData,currentRange,0,0,compensateErrorForWidth);
temp = stepperData(1,3)*1e-3;
saveStruct.X0 = stepperData(1,2)*1e-3;
saveStruct.Y0 = temp - saveStruct.flowAngle*saveStruct.X0;
saveStruct = ErrorTest(saveStruct,compensateErrorForWidth);
save([savePathData saveName '.mat'],'saveStruct')
[saveStruct, stretches, rod, turns, drift, velocity] = PlotTrajectories(saveStruct,closeAllWindows,errorbars);
save([savePathData saveName '.mat'],'saveStruct')
% PlotOrbit(saveStruct,facemapMatch);
catch err
% errorFiles = [errorFiles saveName];
rethrow(err)
% continue
end
saveStruct.saved = 0;
if saveStruct.saved == 0
savefig([savePathPlot saveName '_A'],stretches,'pdf')
savefig([savePathPlot saveName '_B'],drift,'pdf')
for i = 1:length(turns)
nrFix = '';
if i < 10
nrFix = '0';
end
savefig([savePathPlot saveName '_C' nrFix num2str(i)],turns(i),'pdf')
end
savefig([savePathPlot saveName '_D'],velocity,'pdf')
% savefig([savePathPlot saveName '_E'],orbit,'pdf')
% for i = 1:length(theoryStretches)
% nrFix = '';
% if i < 10
% nrFix = '0';
% end
% savefig([savePathPlot saveName '_E' nrFix num2str(i)],theoryStretches(i),'pdf')
% end
savefig([savePathRod saveName],rod,'pdf')
% % Save the annotations
% fid = fopen([savePathAnnot, saveName, 'annotations.tex'],'w');
% fprintf(fid,'\\caption{' , 'uchar');
% fprintf(fid, ['$\\lambda$ = ', num2str(saveStruct.rodLength/3), '\n'], 'uchar'); %write data
% fprintf(fid, ['$ x_0 = ', num2str(round(saveStruct.X0*1000)), ' \\mu m, z_0 = ', num2str(round(saveStruct.Y0*1000)) ,'\\mu m$']);
% fprintf(fid, ['Depth approx ' num2str(saveStruct.depth), '$\\mu$ m']);
% for i=1:length(saveStruct.annots)
% fprintf(fid, saveStruct.annots{i}, 'uchar'); %write data
% end
% fprintf(fid, '}', 'uchar');
% fclose(fid);
saveStruct.saved = 1;
end
disp(saveName);
% close all
% saveStruct = FitValuesToFacemap(saveStruct);
save([savePathData saveName '.mat'],'saveStruct')
% end

Kategorien

Mehr zu Graph and Network Algorithms finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by