matlab and c# working with same file
Show older comments
Hi. So I have C# application that constantly edits data.txt like this:
while(true){
open data.txt;
overwrite old data with new data;
close data.txt;
wait 1 second;
}
The file always contains one number. While that is happening I'm using matlab to read data.txt like this:
sum = 0;
i = 0;
while(i < 1000){
i = i+1;
open data.txt;
number = read data.txt;
close data.txt;
sum = sum + number;
}
At the end, I always get that sum = []. What should I do to fix this problem? Thank you.
Accepted Answer
More Answers (1)
Alokin Jago
on 27 Nov 2011
0 votes
Categories
Find more on Communications Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!