How to convert Matlab program into visual basic? Entry level at VB.
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
%list of parameters to be logged
Param{1} = 'Acceleration';
Param{2} = 'Speed';
Param{3} = "Breaking';
%time rate
Rate = 100;
logFileName = fullfile(pwd,'Log1.csv');
monitorMode = 'RequestReceive';
loggingMode = 'Alldatareceived';
%double value can be passed
result = widgetwrapper.StartLoggin(param,Rate,monitorMode,logFileName,loggingMode,0);
pause(10);
widgetwrapper.StopLogging();
msgbox('RequestReceive with All data mode logging complete');
logFileName = fullfile(pwd,'Log2');
monitorMode = 'EDM';
result = widgetwrapper.StartLogging(param, Rate, monitorMode, logFileName, loggingMode, 30);
pause(10);
widgetwrapper.StopLogging();
msgbox('EDM with all data mode logging complete');
0 Kommentare
Antworten (1)
Walter Roberson
am 3 Nov. 2019
widgetwrapper appears to be some Java code from NorthWestern University.
Converting java to VB is outside the scope of MATLAB Answers.
We do not deal much with VB here, and what we do is more about the interface between MATLAB and VB.
The code appears to log 10 seconds of data of an EDM to a file. It is not really clear what "EDM" means for the purpose of this program; it might possibly refer to Electronic Distance Measurement; https://en.wikipedia.org/wiki/Rangefinder but the parameters mentioned would tend to suggest Accelerometer or possibly vehicle network instrument logging more than range finder to me.
Effectvely MATLAB is just acting as a carrier program to activate the interesting actions in Java. You are going to need to concentrate on calling Java from VB. See https://social.msdn.microsoft.com/Forums/vstudio/en-US/36d0cd27-071f-41de-8d03-633bf43f041c/call-java-class-from-visual-basic?forum=vbgeneral and https://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=2633&lngWId=2
1 Kommentar
Guillaume
am 3 Nov. 2019
In any case, it's not even clear what VB the OP is talking about. It could be the long deprecated VB6, it could be VBA or maybe VB.Net. If the latter, why not use matlab compiler to generate a .Net library.
Siehe auch
Kategorien
Mehr zu MATLAB Compiler finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!