Integrating Matlab project with c# application with visual studio C#.
Show older comments
I have created one module i.e (Vehicle number plate recognition) in MatLab and the other module (vehicle management system) in C#, Now i want to integrate these. Help me kindly
2 Comments
What does integrate these actually mean?
What is it that you don't know how to do?
Rya
on 11 Jul 2017
Answers (1)
Walter Roberson
on 10 Jul 2017
0 votes
19 Comments
Rya
on 10 Jul 2017
Walter Roberson
on 10 Jul 2017
Sorry, I know very little about .NET assemblies.
Rya
on 10 Jul 2017
Walter Roberson
on 10 Jul 2017
Please ask a more specific question about cell arrays.
You use cell arrays much the same way you use other arrays. Construct a logical vector indicating for each row whether the row matches the criteria you have in mind. Then you can use that vector to act on corresponding elements. For example,
car_is_blue = ismember(ANPR(:,6), 'blue');
car_is_sedan = ismember(ANRP(:,7), 'sedan');
car_is_blue_sedan = car_is_blue & car_is_sedan;
blue_sedan_entries = ANPR(car_is_blue_sedan, :);
Rya
on 11 Jul 2017
Walter Roberson
on 11 Jul 2017
ANPR(end+1,:} = CellWithNewData; %to add data
car_is_blue = ismember(ANPR(:,6), 'blue');
car_is_sedan = ismember(ANRP(:,7), 'sedan');
car_is_blue_sedan = car_is_blue & car_is_sedan;
blue_sedan_entries = ANPR(car_is_blue_sedan, :);
ANPR(blue_sedan_entries,:) = []; %to delete specific data
Walter Roberson
on 12 Jul 2017
prompt = {'Enter license plate', 'Enter owner', 'Enter model', 'Enter color', 'Enter year', 'Enter VID'};
dlg_title = 'Enter registration information';
responses = inputdlg(prompt, dlg_title);
new_ANPR_row = responses(:).'; %turn it into a row vector
ANPR(end+1, :) = new_ANPR_row; %add the entry to the end
Walter Roberson
on 12 Jul 2017
filestruct = load('DB.mat');
DB = filestruct.DB;
prompt = {'Enter license plate', 'Enter owner', 'Enter Vehicle type', 'Enter color', 'Enter manufacturer', 'Enter model', 'Enter year', 'Enter Image file name'};
dlg_title = 'Enter registration information';
responses = inputdlg(prompt, dlg_title);
new_DB_row = responses(:).'; %turn it into a row vector
year_numeric = str2double(new_DB_row{7});
if ~isnan(year_numeric); new_DB_row{7} = year_numeric; end
new_DB_row{8} = uint8(new_DB_row{8}(:)); %I don't know why you do not just leave the file name as a character vector
DB(end+1, :) = new_DB_row; %add the entry to the end
save DB DB
Rya
on 12 Jul 2017
Walter Roberson
on 12 Jul 2017
set(handles.DBtable, 'data', DB) %update your uitable
Rya
on 13 Jul 2017
Walter Roberson
on 13 Jul 2017
You are making me do a lot of guessing about what you might have written in your code.
Rya
on 13 Jul 2017
Walter Roberson
on 13 Jul 2017
... by posting your code? Untitled_1_Callback at the very least, but I suspect I might need more.
Rya
on 14 Jul 2017
Edited: Walter Roberson
on 15 Jul 2017
Walter Roberson
on 15 Jul 2017
%notice I got rid of NPR file
function New_Vehicle_Callback(hObject, eventdata, handles)
filestruct = load('DB.mat');
DB = filestruct.DB;
prompt = {'Enter VPN', 'Enter owner', 'Enter Vehicle type', 'Enter color', 'Enter Make', 'Enter model', 'Enter year', 'Enter Image file name'};
dlg_title = 'Enter registration information';
responses = inputdlg(prompt, dlg_title);
new_DB_row = responses(:).'; %turn it into a row vector
year_numeric = str2double(new_DB_row{7});
if ~isnan(year_numeric); new_DB_row{7} = year_numeric; end
new_DB_row{8} = new_DB_row{8};
DB(end+1, :) = new_DB_row;
save DB DB
set(handles.DBtable, 'data', DB)
function Search_panel_Callback(hObject, eventdata, handles)
filestruct = load('DB.mat');
DB = filestruct.DB;
[tf, idx] = ismember(x, DB(:,1));
if ~tf
errordlg( 'Vehicle with VPN is not found','Error');
Information_About_This_Plate = {};
return
end
Information_About_This_Plate = DB(idx, :);
bgcol = [.83 .82 .78];
datacol = [1 1 1];
label=[.93 .93 .93];
fig = figure('color', bgcol, 'Units', 'pixels','Position', [10, 50, 609, 470],'Name','Vehicle Description Panel');
L0 = uicontrol(fig, 'style', 'text', 'units', 'pixels','FontSize', 15,'Position', [430 370 50 30], 'background', bgcol, 'string', 'VPN:');
L1 = uicontrol(fig, 'style', 'text', 'units', 'pixels','FontSize', 15,'Position', [20 330 150 40], 'background', bgcol, 'string', 'Owner:');
L2 = uicontrol(fig, 'style', 'text', 'units', 'pixels','FontSize', 15, 'Position',[20 270 150 40], 'background', bgcol, 'string', 'Vehicle Type:');
L3 = uicontrol(fig, 'style', 'text', 'units', 'pixels','FontSize', 15, 'FontSize', 15,'Position',[20 220 150 40], 'background', bgcol, 'string', 'Color:');
L4 = uicontrol(fig, 'style', 'text', 'units', 'pixels', 'FontSize', 15,'Position',[20 170 150 40], 'background', bgcol, 'string', 'Make:');
L5 = uicontrol(fig, 'style', 'text', 'units', 'pixels','FontSize', 15,'Position', [20 120 150 40], 'background', bgcol, 'string', 'Model:');
L6 = uicontrol(fig, 'style', 'text', 'units', 'pixels','FontSize', 15, 'Position',[20 70 150 40], 'background', bgcol, 'string', 'Year:');
D0 = uicontrol(fig, 'style', 'text', 'units', 'pixels', 'FontSize', 15,'Position',[480 370 100 30], 'background',bgcol, 'string', Information_About_This_Plate{1});
D1 = uicontrol(fig, 'style', 'text', 'units', 'pixels', 'FontSize', 12,'Position',[180 330 150 40], 'background',datacol, 'string',(Information_About_This_Plate{2}));
D2 = uicontrol(fig, 'style', 'text', 'units', 'pixels', 'FontSize', 12,'Position',[180 270 150 40], 'background', datacol, 'string', Information_About_This_Plate{3});
D3 = uicontrol(fig, 'style', 'text', 'units', 'pixels', 'FontSize', 12,'Position', [180 220 150 40], 'background', datacol, 'string', Information_About_This_Plate{4});
D4 = uicontrol(fig, 'style', 'text', 'units', 'pixels','FontSize', 12, 'Position', [180 170 150 40], 'background', datacol, 'string', Information_About_This_Plate{5});
D1 = uicontrol(fig, 'style', 'text', 'units', 'pixels','FontSize', 12, 'Position',[180 120 150 40], 'background',datacol, 'string', Information_About_This_Plate{6});
D2 = uicontrol(fig, 'style', 'text', 'units', 'pixels','FontSize', 12, 'Position',[180 70 150 40], 'background', datacol, 'string', Information_About_This_Plate{7});
imfile = Information_About_This_Plate{8};
if ~ischar(imfile)
imfile = char(imfile(:).');
end
if isempty(imfile) || ~exists(imfile, 'file')
fids = {'testpat1.png', 'pout.tif', 'kobi.png'};
imfile = fids{randi(length(fids))};
end
ax = axis(fig, 'Units', 'pixels', 'Position', [400 30 20 50]);
[imcontent, immap] = imread(imfile);
if ~isempty(immap)
imcontent = ind2rgb(imcontent, immap);
end
axi = image(imcontent, 'Parent', ax);
axis(axi, 'image', 'off');
Rya
on 17 Jul 2017
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!