Why MATLAB release R2014b results on MAC is different from results on windows?

3 views (last 30 days)
I ran exactly the same program on both Mac and windows but the results are different. Look to the * and 'diamond' plotted on Y axis. in windows I have the proper plot, but in mac the * and 'diamond' are overlapped. How can I solve this? I am analyzing data. but the results that are being plotted are different, winodows plot:
mac plot:
especially for a section that I used following codes(I think there the problem are MAX, MIN, STD functions and windows MATLAB is calculating properly.):
E=std(avrFR);
Emat=repmat(E,size(avrFR,1),1);
errorbar(avrFR,Emat,'LineWidth',1)
ylimmax1(iL1,iL3)=max((max(avrFR,[],2)),[],1);
ylimmin1(iL1,iL3)=min((min(avrFR,[],2)),[],1);
% hleg(L1,L3)=legend(legendTitle,'Location','BestOutside'); % set(hleg(L1,L3),'Box', 'off')
hleg(iL1,iL3)=legend(legendTitle,'Location','northeast');
set(hleg(iL1,iL3),'Box', 'off')
% legend('off')
hold on
plot(0,avrFRshapeonly(iL1),'r*')
if (EX.rep_Blank_Rand_Foronly_ShowBG_Foronly2nd(6)==1)
plot(0,avrFRshapeonly2ndcolor(iL1),'gd')
end
figTitle=sprintf('shape:%d Spot Radius:%d',iL1,round(Y(iL3)));
title(figTitle);
xlabel('Spot Location Index')
axis square
axis tight
end
end
yalimmax2=max(ylimmax1,[],2); yalimmin2=min(ylimmin1,[],2); % ml=length(yalimmax2);
subpL2=0; for iL1=1:L1 for iL3=1:L3 subpL2=subpL2+1; subplot(L1,L3,subpL2); % if L1==1 % axis([0 length(spotlocIndex) yalimmin2 yalimmax2]); % % Z=max(avrFRshapeonly(iL1),avrFRshapeonly2ndcolor(iL1)); if (yalimmax2(iL1)<Z) axis([0 maxLengthspotloc(iL1) yalimmin2(iL1) Z+1 ]); else axis([0 maxLengthspotloc(iL1) yalimmin2(iL1) yalimmax2(iL1)]); end
end
end
Thanks, Majid

Answers (2)

John D'Errico
John D'Errico on 29 Jan 2015
This question gets asked over and over again. The answer is generally that when the data was moved across systems, it was not moved exactly. If you wrote it out as an ascii file for example, those numbers will not be written to the full precision stored internally. And too often people copy over only a few digits of the numbers, thinking that the 4 digits they saw displayed in the command window were the true numbers as stored.
There are other reasons for differences. I don't have your data, nor can I read your code since it is formatted so poorly. But sometimes there are issues with random numbers and different seeds. I don't see anything in what I read that would have a random number in it. However, anything is possible. I don't know if some of those things with strange names are functions of your own creation for example.
And, finally, you don't say what was different, and to what extent, nor do you provide the data to test it. So at best, any response is just a guess.
  1 Comment
Mohammad Abouali
Mohammad Abouali on 29 Jan 2015
As john said, provide some example so we see how the two results are different.
I have also noticed sometimes different JVM or system produce different results. But the difference is usually after 6th 7th number of the period. So not a major difference.

Sign in to comment.


Jan
Jan on 2 Feb 2017
Check if this is a problem of the graphics, or if the values are diffrerent:
fprintf('avrFRshapeonly(%d): %g\n', iL1, avrFRshapeonly(iL1))
fprintf('avrFRshapeonly2ndcolor(%d): %g\n', iL1, avrFRshapeonly2ndcolor(iL1))
What do you observe? If the values are different, examine the code, which calcluates these variables.

Categories

Find more on Specifying Target for Graphics Output in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!