Got any MATLAB experience?

Donagh

New Member
Hi guys,
I working with MATLAB at the moment, I’ve some experience but not an awful lot. I’ve been asked to make a real time processing function in MATLAB, and that’s the thing. I have made all of the operations functions and everything is ready to go but I’m not sure how to operate MATLAB in real time, I don’t even know where to start.
Anyone got any pointers?
 
I often hear about that the data acquisition use the RS232 serial port. Is that your need?
 
No I have that working already, I'm taking serial strings from a microcontroller and processing them but I can only do it in a stop go sort of way, one string at a time. What I need is nonstop string processing in some sort of loop, and then I suppose I would have graphs updating with the new information that’s coming in.
 
I can understand your meaning. For example, the record graphic of a whole year temperature.
If you were using a ”for“ cycle operation. Can it work?

 
Yeah that’s exactly how I did it. I think now though that what I’m looking for cant actually be done with MATLAB unless I pre define it to run like 1000 times. I only have to do this for a demonstration of my hardware capabilities and the next team will handle the programming interface.
Here's my code:

% Function: STRINGGET
%
% Description: code for capturing a string trtminated by 'w'
% String Description: <-...,w,w,w,w,w,w,R0444,G0444,.......,t20,W,w,w,w,w,...->
% Trigger: 'S'
% Serial Port Terminator: 'w'
% BaudRate : 19200
% Input Buffer Size: 4500 CHAR
% Timeout: 60 seconds
%
% Inputs: ADuC842 UART serial string
% Outputs: serial string

s = serial('COM1');
%create serial port object on COM1

set(s,'BaudRate',19200, 'Parity','none', 'Terminator', 'w', 'InputBufferSize', 4500, 'Timeout', 60);
% set serial port object peramiters

fopen(s);

fprintf(s, 'S'); % send 'S' CHAR to ADuC842

str = fgetl(s); % read string from input buffer of serial port object

k = str % move string into k for opperations

fclose(s);
delete(s) % object must be closed, deleted and removed from the workspace
clear s

I can run this in a for loop with 1:1000 and make some kickass graphs.
I been looking into plotting now and I have arrays like P_Ar(1 to 6,1 to 1000,1 to 62)
do you think I should try and plot this info as it comes in or after I have finished placing it into the array.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…