Home > Software engineering >  O great god solve the problem of the vb call MATLAB program
O great god solve the problem of the vb call MATLAB program

Time:09-25

Write your own program prompts when converted into a com component Error Error using the==& gt; Cmptool> Bulid
Error: the File "Konw - data" is a script M - the File and always be compiled with the current Compiler.
(program is more simple, more is just data)
Pray god to solve thank you

P=[2.1329 2.2364 4.2143 3.5392 3.7349 0.5658 0.6537 0.2496;
1.4237 1.4414 2.9041 2.1076 2.8138 0.4337 0.5145 0.2045;
1.1423 1.1917 2.4049 1.5040 2.0923 0.2884 0.3256 0.1941;
0.9641 1.1029 2.1104 0.8997 1.7167 0.2206 0.2368 0.0766;
1.9623 2.2138 4.1505 3.0073 3.5051 0.4962 0.5759 0.2091;
2.0554 2.2913 4.4578 3.0064 3.9799 0.5954 0.6961 0.2454;
1.1887 1.3242 2.5919 1.5149 2.1879 0.2777 0.3156 0.1572;
1.1762 1.3840 2.6347 1.1066 1.9657 0.2362 0.2576 0.0879;
1.8830 2.1891 4.1069 2.7970 3.3061 0.4733 0.5176 0.1941;
1.8058 1.8210 3.5942 2.7796 3.5514 0.5728 0.6781 0.2457;
1.2113 1.3324 2.6267 1.4499 2.2559 0.3095 0.3314 0.1556;
1.3627 1.5622 2.9368 1.3071 2.5098 0.3354 0.3522 0.1224;
1.7466 2.0496 3.8267 2.6054 3.2447 0.4486 0.5106 0.1703;
1.4933 1.4985 3.0207 2.1467 2.9203 0.4630 0.5274 0.2112;
1.2735 1.4002 2.7454 1.4823 2.3844 0.3299 0.3555 0.1697;
1.3343 1.5561 2.9557 1.2760 2.4284 0.3229 0.3430 0.1352;
1.5815 1.8360 3.4809 2.3606 2.9496 0.4285 0.4715 0.1648;
1.8699 1.8815 3.7590 2.7671 3.5261 0.5457 0.6394 0.2252;
1.3163 1.5043 2.9163 1.5546 2.4345 0.3281 0.3641 0.1492;
1.3553 1.5763 2.9829 1.3260 2.5040 0.3378 0.3549 0.1300;
1.5207 1.7405 3.3100 2.2001 2.7955 0.4025 0.4367 0.1663;
1.8146 1.9059 3.7568 2.5816 3.4864 0.5124 0.6037 0.2237;
1.4310 1.5784 3.1111 1.6645 2.6151 0.3571 0.3919 0.1700;
1.2870 1.5201 2.8666 1.2610 2.4018 0.3113 0.3384 0.1202] ';
T=[0 0 0 1;
1 0 0 0;
1 0 0 0;
1 0 0 0;
0 0 0 1;
1 0 0 0;
1 0 0 0;
1 0 0 0;
0 0 0 1;
1 0 0 0;
1 0 0 0;
1 0 0 0;
0 0 0 1;
1 0 0 0;
1 0 0 0;
1 0 0 0;
0 0 0 1;
1 0 0 0;
1 0 0 0;
1 0 0 0;
0 0 0 1;
1 0 0 0;
1 0 0 0;
1 0 0 0] ';
Threshold=[0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1].
Net=newff (threshold, [5, 4] and {' tansig ', 'logsig},' trainlm);
Net. TrainParam. Epochs=10000;
Net. TrainParam. Goal=0.01;
LP. Lr=0.01;
Net="train" (.net, P, T);
P_test=[1.5815 1.7899 3.4642 2.2858 2.8504 0.4154 0.4544 0.1654;
1.9340 2.0707 4.0968 2.8013 3.6772 0.5457 0.6308 0.2487;
1.4386 1.5717 3.0683 1.6974 2.9444 0.4154 0.4526 0.1471;
1.2601 1.4811 2.8089 1.2052 2.2596 0.2844 0.3122 0.1175;
1.6358 1.8754 3.6573 2.4583 3.0403 0.4724 0.4941 0.1807;
1.6132 1.6315 3.3125 2.4287 3.1614 0.4642 0.5588 0.1978;
1.4972 1.6575 3.2191 1.7270 3.0686 0.4321 0.4660 0.1590;
1.2058 1.4069 2.6514 1.1328 2.1747 0.2777 0.3092 0.1047;
2.0237 2.2187 4.2314 3.1223 3.7709 0.5866 0.6571 0.2365;
1.8513 1.9062 3.8231 2.6048 3.5560 0.5457 0.6333 0.2384;
1.4628 1.6416 3.1999 1.6712 2.9163 0.4068 0.4456 0.1505;
1.2452 1.4615 2.7479 1.1670 2.2211 0.2875 0.3146 0.1315;
1.9187 2.1567 4.1450 2.8751 3.6738 0.5530 0.6226 0.2255;
1.9349 1.9965 3.9924 2.6737 3.6473 0.5490 0.6494 0.2460;
1.4493 1.6437 3.1617 1.6163 2.9011 0.4050 0.4309 0.1471;
1.2268 1.4325 2.7274 1.1710 2.3054 0.3049 0.3357 0.1199] ';
Y=sim (.net, P_test)




CodePudding user response:

Don't be A language code is modified to B language code busywork,
Also don't use A language code to directly invoke B language code base, this complicated things so easy to get wrong,
Just make A, B language code of input and output is redirected to A text file, or modify A, B language code let it through text file input and output,
Can easily make A, B coordination between the two languages,
For example:
A will request data written to A file a.t xt, renamed after finish aa. TXT
B find aa. TXT, read its contents, call the corresponding function, and writes the results file b.t xt, after finish delete aa. TXT, changed its name to bb. TXT
Found A bb. TXT, read the content, after finish delete bb. TXT
Above can be replaced by any kind of A language or development environment, B can be replaced by any kind of with the development of A different language or development environment,
Unless A or B does not support to determine whether A file exists, file read and write and file name,
But who can name does not support to determine whether a file exists, file read and write and file name for the development of language or development environment?
Can put the temporary files on the RamDisk efficiency decrease wear disk,
Data structure is very complex, a text file format problems refer to a json or XML

The communication methods between the temporary text file sharing this process there are plenty of advantages, compared to other method only listed below I can think of now:
Loose coupling between process,
Can be on the same machine, process, also can cross machine, across the operating system, hardware platform, and even multinational,
, convenient debugging, and monitoring, only let the third party or artificial view the temporary text files,
Switch, convenient online service, need to delete or create the temporary text files,
, is convenient to realize distributed and load balancing,
Services to provide convenient, queue, queue is full and it is almost impossible to happen (unless the hard disk space full)
DE...

"Across different languages, machine, across the operating system, hardware platform, multinational, cross *. *" this suffering,
back "exchange of information using Shared plain text file" shore!
  • Related