how can we run two matlab codes simultaneously in a single file where these two are independent to eadh other??
    3 Ansichten (letzte 30 Tage)
  
       Ältere Kommentare anzeigen
    
    avinash pabbireddy
 am 19 Nov. 2013
  
    
    
    
    
    Beantwortet: Walter Roberson
      
      
 am 11 Mär. 2014
            tic
clc; close all; clear all;  
delete(instrfindall);
s = serial ( 'COM5', 'BaudRate', 115200);
set(s, 'Timeout',60);
s.InputBufferSize =37020;
tic
fopen(s);
%for i=1:20
data=fread(s);
----------------------------------------------------------
s = daq.createSession('ni');
s.addAnalogInputChannel('cDAQ2Mod1', 0, 'Voltage');
s.addAnalogInputChannel('cDAQ2Mod1', 1, 'Voltage');
s.Rate = 2000
s.DurationInSeconds = 60;
[data5,time] = s.startForeground;
toc
3 Kommentare
Akzeptierte Antwort
  Walter Roberson
      
      
 am 11 Mär. 2014
        You might be able to use spmd with two labs, one for the data acquisition and the other for the serial fread(). I do not have enough knowledge of the Parallel Computing Toolbox to be sure that it can be done.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
				Mehr zu Parallel for-Loops (parfor) finden Sie in Help Center und File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

