Different markers in MATLAB plot -


i'm using generated code plot psychometric function between 2 vectors:

smqi=[0 0.504500000000000   0.540500000000000   0.574800000000000   0.459400000000000   0.500800000000000   0.533900000000000   0.401700000000000   0.462100000000000   0.511300000000000   0.291300000000000   0.347300000000000   0.419900000000000   0.491700000000000   0.552400000000000   0.598600000000000   0.392600000000000   0.426000000000000   0.451400000000000   0.334900000000000   0.359500000000000   0.371300000000000   0   0.640800000000000   0.760600000000000   0.847100000000000   0.336200000000000   0.409200000000000   0.463000000000000   0.357600000000000   0.437700000000000   0.504400000000000   0.421200000000000   0.500200000000000   0.579800000000000   0.452700000000000   0.557200000000000   0.592200000000000   0.314800000000000   0.313800000000000   0.344800000000000   0.315500000000000   0.348300000000000   0.355400000000000   0   0.558100000000000   0.636700000000000   0.702900000000000   0.361500000000000   0.427100000000000   0.469100000000000   0.389700000000000   0.457700000000000   0.489800000000000   0.446800000000000   0.528700000000000   0.589200000000000   0.441500000000000   0.475300000000000   0.499600000000000   0.325500000000000   0.360700000000000   0.364200000000000   0.338400000000000   0.368200000000000   0.396200000000000   0   0.702500000000000   0.813100000000000   0.995500000000000   0.370600000000000   0.476800000000000   0.594300000000000   0.355200000000000   0.452000000000000   0.528500000000000   0.484000000000000   0.567400000000000   0.671500000000000   0.454000000000000   0.460700000000000   0.469600000000000   0.299900000000000   0.318300000000000   0.361900000000000   0.264800000000000   0.263000000000000   0.279500000000000]; mos=[0.240085000000000  0.558541000000000   0.861963000000000   0.935125000000000   0.276903000000000   0.634308000000000   0.838878000000000   0.268853000000000   0.274772000000000   0.724518000000000   0.285545000000000   0.238901000000000   0.477684000000000   0.338700000000000   0.655736000000000   0.656328000000000   0.138511000000000   0.388422000000000   0.582929000000000   0.368178000000000   0.364626000000000   0.341423000000000   0.237362000000000   0.728069000000000   0.894282000000000   1   0.348526000000000   0.689712000000000   0.712087000000000   0.473541000000000   0.558778000000000   0.600331000000000   0.480052000000000   0.638688000000000   0.924944000000000   0.349947000000000   0.765834000000000   0.826684000000000   0.279507000000000   0.315852000000000   0.529892000000000   0.193678000000000   0.282112000000000   0.375873000000000   0.266012000000000   0.536285000000000   0.739079000000000   0.924825000000000   0.362969000000000   0.516160000000000   0.724162000000000   0.417663000000000   0.649461000000000   0.682846000000000   0.540784000000000   0.823606000000000   0.900438000000000   0.277850000000000   0.318693000000000   0.433763000000000   0.221617000000000   0.281165000000000   0.381674000000000   0.141352000000000   0.335740000000000   0.391263000000000   0   0.659879000000000   0.834853000000000   0.953475000000000   0.502664000000000   0.609921000000000   0.818042000000000   0.402155000000000   0.543270000000000   0.755890000000000   0.470700000000000   0.621996000000000   0.748905000000000   0.375873000000000   0.501243000000000   0.682254000000000   0.126080000000000   0.294779000000000   0.353972000000000   0.223748000000000   0.369599000000000   0.261276000000000]; function [fitresult, gof] = createfit(smqi, mos) %createfit(smqi,mos) %  create fit. % %  data 'untitled fit 1' fit: %      x input : smqi 1x88 %      y output: mos  1x88 %  output: %      fitresult : fit object representing fit.  [xdata, ydata] = preparecurvedata(smqi, mos);  % set fittype , options. ft = fittype( 'erfc((a+b*x)/sqrt(2))/2', 'independent', 'x', 'dependent', 'y' ); opts = fitoptions( 'method', 'nonlinearleastsquares' ); opts.algorithm = 'levenberg-marquardt'; opts.display = 'off'; opts.startpoint = [0.83763959965349 0.463660782983039];  % fit model data. [fitresult, gof] = fit( xdata, ydata, ft, opts );   % plot fit data. figure( 'name', 'untitled fit 1' ); h = plot( fitresult, xdata, ydata ); legend( h, 'mos vs. smqi', 'untitled fit 1', 'location', 'northeast' ); % label axes xlabel smqi ylabel mos grid on 

i want specify different markers each group of 22 values of vectors smqi , mos while preserving same line (fitresult). looked after scatter function didn't succeed solving issue.

help?

the easiest thing do, reshape xdata , ydata variables [x x 4] , pass these plot create separate plot object each group. can set markers desired.

xdata = reshape(xdata, [], 4); ydata = reshape(ydata, [], 4);  p = plot(xdata, ydata, '.'); set(p, {'marker'}, {'.'; 'o'; 'x'; '*'})  hold on plot(fitresult); 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -