How to compare the results of different m files and display it in VB.net

2 ビュー (過去 30 日間)
Ahmed Siddig
Ahmed Siddig 2018 年 6 月 23 日
コメント済み: Ahmed Siddig 2018 年 6 月 23 日
Hello, I have a VB.net application which display the result after executing a matlab m file. So if i have multiple m files i want execute them and then i want to display the highest result among them. Let's say we have 4 m files of the code below but with different values of r at the output' and i want to plot the one with the highest value of r in VB.net how can i achieve that?
function y = loadFile(filename) fid = fopen(filename,'rb'); y = fread(fid,'uint8=>double'); y = y-127.5; y = mean(y(1:2:end) + i*y(2:2:end)); compass(y) r=5-y
thanks.

回答 (1 件)

Tamir Suliman
Tamir Suliman 2018 年 6 月 23 日
編集済み: Tamir Suliman 2018 年 6 月 23 日
THis is how i see it:
get the file names loop through the results or compare the result
% Retrieve all the files in a directory
names = dir('C:\Users\files12*.m');
names = {names.name};
  1 件のコメント
Ahmed Siddig
Ahmed Siddig 2018 年 6 月 23 日
OK suppose i have the first m file in matlab: fid = fopen('1.dat','rb'); y = fread(fid,'uint8=>double'); y = y-127.5; y = mean(y(1:2:end) + i*y(2:2:end)); compass(y) r=5-y
The second one is:
fid = fopen('1.dat','rb'); y = fread(fid,'uint8=>double'); y = y-127.5; y = mean(y(1:2:end) + i*y(2:2:end)); compass(y) r=30-y
and a third one:
fid = fopen('1.dat','rb'); y = fread(fid,'uint8=>double'); y = y-127.5; y = mean(y(1:2:end) + i*y(2:2:end)); compass(y) r=55-y
and in VB.net i have a button when i press it it executes each one independently i want to make a button which compares the different values of r and plot the highest.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGet Started with Microsoft .NET についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by