I want to compile a gui matlab project, but fail because of this error which is not in my code
Subscript indices must either be real positive integers or logicals.
Error in isscript (line 7)
if strcmpi(pth(end-1:end), '.m') && exist(pth, 'file') == 2
Error in matlab.depfun.internal.Schema/move/#(setMembers)setMembers(~isscript(setMembers))
Error in matlab.depfun.internal.Schema>applyMoveFcn (line 987)
keptFiles = fcn(fileList);
Error in matlab.depfun.internal.Schema>#(files,destMap)applyMoveFcn(op,files,destMap,destSet,reason,rule) (line 822)
#(files, destMap)applyMoveFcn(op, files, destMap, ...
Error in matlab.depfun.internal.Schema/applySetRules (line 141)
xformedSet = feval(operations{n}, xformedSet, rMap);
Error in matlab.depfun.internal.Completion/applySetRules (line 1059)
[modifiedList, rMap] = ...
Error in matlab.depfun.internal.Completion/initializeRootSet (line 1142)
[addedFiles, ruleFilter, notes] = ...
Error in matlab.depfun.internal.Completion (line 1601)
obj.RootSet = initializeRootSet(obj, files);
Error in matlab.depfun.internal.requirements (line 166)
c = matlab.depfun.internal.Completion(files, tgt);
Error in appcreate.internal.appbuilder.getDependencyList (line 173)
[dependentfiles, depproducts, ~] = matlab.depfun.internal.requirements(varargin, 'MATLAB');
How can I get matlab (2013b) to compile the package?
The code where matlab fails is (which is NOT my code)
function tf = isscript(files)
% ISSCRIPT Is the file a script file?
tf = false(1,numel(files));
for k=1:numel(files)
pth = files{k};
% Can't be a script if it isn't an M-file.
if strcmpi(pth(end-1:end), '.m') && exist(pth, 'file') == 2
mt = matlab.depfun.internal.cacheMtree(pth);
fcn = mtfind(mt, 'Kind', 'FUNCTION');
tf(k) = isempty(fcn);
end
end
The code will fail for files with a filename of length 1. Either rename all files with such a short filename or change the line to:
if length(pth)>1 && strcmpi(pth(end-1:end), '.m') && exist(pth, 'file') == 2
Related
I'm for now compiling in CPU version.I am working on matlab 2020a.I've tried to remove the vl_nnconv.m from matconvnet but i still get the following error.
Also the matconvnet i'm using is version matconvnet-1.0-beta25 I'm stuck here since 2 days ,could somebody lease help me out with this issue?
https://github.com/XinLi-zn/TADT
The above is the github code i'm trying to work on.
Foloowing are the errors i'm getting:
Error using vl_nnconv
The option name is not a string (argument number 5)
Error in dagnn.Conv/forward (line 11)
outputs{1} = vl_nnconv(...
Error in dagnn.Layer/forwardAdvanced (line 85)
outputs = obj.forward(inputs, {net.params(par).value}) ;
Error in dagnn.DagNN/eval (line 91)
obj.layers(l).block.forwardAdvanced(obj.layers(l)) ;
Error in get_subwindow_feature (line 37)
net_feat.eval({'input',gpuArray(patch_sw)});
Error in tadt_tracking (line 63)
feat_groups = get_subwindow_feature(net_feat, img, sw_location, input_sz, feat_layer);
Error in Demo_TADT (line 23)
[result, fps]=tadt_tracking(seq_info.img_list, seq_info.gt(1,:), vgg16_model_path, display);
the following are the functions that is causing the error and the argument is obj.pad
function outputs = forward(obj, inputs, params)
if ~obj.hasBias, params{2} = [] ; end
outputs{1} = vl_nnconv(...
inputs{1}, params{1}, params{2}, ...
'pad', obj.pad, ...
'stride', obj.stride, ...
obj.opts{:}) ;
end
I'm trying to make a connection to hardware (a controller of a moving stage) from Physik Insrumente using MATLAB. However, I have tried using the code that the company provided but did not work, so I have simplified but still doesn't work.
Here is my code:
addpath ( 'C:\Users\Public\PI\PI_MATLAB_Driver_GCS2' );
Controller = PI_GCS_Controller();
controllerSerialNumber = '118011005';
C867 = Controller.ConnectUSB(controllerSerialNumber);
display(C867.qIDN())
I am getting this error message:
PI_MATLAB_Driver_GCS2 loaded successfully.
Error using PI_GCS_Controller/ConnectUSB (line 17)
There is no interface or DLL handle with the given ID
Error in PI_GCS_Controller/ConnectUSB (line 17)
error(szDesc);
Error in PI_GCS_Controller/subsref (line 46)
varargout{1} = feval(fun,c,par{1});
Error in Untitled (line 5)
C867 = Controller.ConnectUSB(controllerSerialNumber);
ConnectUSB is:
function [c] = ConnectUSB(c,szIdentifier)
FunctionName = 'PI_ConnectUSB';
if(any(strcmp(FunctionName,c.dllfunctions)))
if(nargin<2), szIdentifier = blanks(5000); end,
try
[c.ID, szIdentifier] = calllib(c.libalias,FunctionName,szIdentifier);
if(c.ID<0)
iError = GetError(c);
szDesc = TranslateError(c,iError);
error(szDesc);
end
catch
rethrow(lasterror);
end
else
error('%s not found',FunctionName);
end
How can I connect to this controller?
I am trying to apply a forward feature selection on a PRdataset. Following the syntax presented online though produces a bunch of errors that I don't quite understand and haven't been able to solve. Any ideas on what is causing them or how to fix?
Code used and resulting errors shown below:
A=prdataset(data,classes);
[w,r]=featself(A,'NN');
Error using indnn (line 50)
Trainset and testset should by identical for LOO processing
Error in fnnc (line 33)
L = indnn(a,trainset,loo);
Error in prmap (line 231)
[d,varargout{:}] = feval(mapp,a,b);
Error in * (line 14)
d = prmap(a,b);
Error in testk (line 55)
d = a*w;
Error in feateval (line 128)
J = 1 - testk(a,1);
Error in featsellr>plusl (line 182)
critval = feateval(a(:,[state.I Jsub]),crit);
Error in featsellr (line 127)
state = plusl(a,crit,t,state,fid);
Error in featself (line 56)
[w,r] = featsellr(a,crit,ksel,1,0,t);
I want to use video from following directory
'E:\Multimedia Security\matlab\UCSD_Anomaly_Dataset.v1p2\UCSDped1\Train\Train001'
Following is the code which i wrote
close all
clear all
clc
workingDir = 'E:\Multimedia
Security\matlab\UCSD_Anomaly_Dataset.v1p2\UCSDped1\Train\Train001';
videoofReader = vision.VideoFileReader(dir(fullfile(workingDir, 'abc.avi')));
videoPlayer = vision.VideoPlayer;
while ~isDone(videoofReader)
frame = step(videoofReader);
step(videoPlayer, frame);
end
release(videoofReader);
release(videoPlayer);
Error which i get is
`Error using VideoFileReader.set.Filename (line 139)
Expected Filename to be one of these types:
char
Instead its type was struct.
Error in C:\Program
Files\MATLAB\R2012a\toolbox\matlab\system\+matlab\+system\setProp.p>setProp
(line 14)
Error in
C:\ProgramFiles\MATLAB\R2012a\toolbox\matlab\system+matlab+system\SystemProp.p>SystemProp.set (line
373)
Error in C:\Program Files\MATLAB\R2012a\toolbox\matlab\system+matlab+system\SystemProp.p>SystemProp.parseInputs
(line 635)
Error in C:\Program
Files\MATLAB\R2012a\toolbox\matlab\system+matlab+system\SystemProp.p>SystemProp.setProperties
(line 138)
Error in C:\Program
Files\MATLAB\R2012a\toolbox\vision\vision+vision\VideoFileReader.p>VideoFileReader.VideoFileReader
(line 131)
Error in kl2 (line 18)
videoofReader = vision.VideoFileReader(dir(fullfile(workingDir, 'abc.avi')));
System prompts you Error in kl2 (line 18) so this line has a problem. You do not need to use dir because you already have an absolute path.
Give you two solutions:
videoofReader = vision.VideoFileReader(fullfile(workingDir, 'abc.avi'));
dirstruct = dir(fullfile(workingDir, 'abc.avi'));
videoofReader = vision.VideoFileReader(dirstruct{1});
I am attempting to use sysic to create an interconnected system from a number of state space models. However; I keep recieving the same error:
Undefined function or variable "Vk".
Error in sysic (line 212)
[ard,arl,er] = LOCALpass1(Vk);
Error in addOutputWeights (line 62)
sysic
The code used that generates this error is as follows:
systemnames = 'plantModel WControl WError';
inputvar = '[r(4); u(4)]';
outputvar = '[WControl; WError;r- plantModel]';
input_to_WError = '[r-plantModel]';
input_to_WControl = '[u]';
sysoutname = 'instramentedPlant';
cleanupsysic= 'yes';
sysic
This error was caused because input_to_plantModel was not present in the workspace. For every system that is refered to in systemnames there must be a corresponding input_to_X.
The following code runs correctly
systemnames='plantModel wControl wError';
inputvar ='[r(4); u(4)]';
outputvar ='[wControl;wError;r- plantModel]';
input_to_plantModel ='[u]';
input_to_wError ='[r-plantModel]';
input_to_wControl ='[u]';
sysoutname ='instramentedPlant';
cleanupsysic = 'yes';