how to trasfer workspace values to another pc?

Basically I've made a real-time simulation and I want to transfer six values from my workspace to another pc, through packet output/input or some other udp block. Im supposed to input the values into my pc and then tranfer and run the simulation on the other pc, but I cant get my values to the other pc.

回答 (1 件)

Gareth Thomas
Gareth Thomas 2014 年 7 月 7 日

1 投票

There are many ways of doing this... however a common way is using MAT Files.
a = rand(10);
b = rand(12);
save myMat a b
clear all
load myMat
Advantages of MAT Files: - this will work across platforms - can be optimised - one can compare mat files without loading them (great for version control) - one can store multiple variables and load only some of them - work across releases, and architectures - There is an open API via C to read/write them
Disadvantages: - they are not aimed for real-time applications
Other ideas (depending on what you are looking for): - UDP streaming - System Objects - CAN messages (see Vehicle Network Toolbox) - Reading/Writting to Databases (See Database Toolbox) - TCP/IP (see Instrument Control Toolbox) - Create Socket in MATLAB - Create COM Ports - Add your own library into MATLAB via C Mex
If you are looking for more ideas I would recommend reaching out to the Helpdesk of the MathWorks, as this may depend strong on your requirements.

3 件のコメント

Amir
Amir 2014 年 7 月 7 日
more like UDP streaming, cause I just want to enter the variables into pc1 and transfer them to pc2 in real time. The simulation starts on pc1 and continues with those variables on pc2.
Andrew Reibold
Andrew Reibold 2014 年 7 月 7 日
編集済み: Andrew Reibold 2014 年 7 月 7 日
Do the computers have a shared network folder? Write them with one computer, read with the other?
Amir
Amir 2014 年 7 月 11 日
No they dont, It working over the internet. Enter the values into the firsts pc and start the simulation then transfer them to the other pc-s workspace and view the results

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

カテゴリ

ヘルプ センター および File ExchangeWorkspace Variables and MAT Files についてさらに検索

質問済み:

2014 年 7 月 7 日

コメント済み:

2014 年 7 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by