a=[5;6;7;8];b=[3.6616;1.5234;0.1589;0.028];b(:,1)semilogy(a,(b(:,1)),'-or');hold on;title ('Plot showing measured data','FontSize',14, 'FontWeight','bold')xlabel('Frequency','FontSize',10, 'FontWeight','bold')ylabel('Magnitude','FontSize',10, 'FontWeight','bold')axis([4.5 8.5 .01 10]);hold ongrid on%Regression
logb=[log10(3.6616);log10(1.5234);log10(0.1589);log10(.028)]A = [a,ones(size(logb))]c = A\by = (A*c)plot(a,y,'o-', a,y,'*-')legend ('Measured Data','Lin. Regression','Location','EastOutside')
MATLAB: How to find linear regression of data as follows
semi-log
Related Question
- Problem with 2nd axis Yticks with plotyy and semilogy
- Graph keeps coming up blank
- How to make loglog subplots
- I want to design xilinx histogram block for MATLAB 7.4.0(R2007) in system generator .I wrote M-Code and simulating but i am geting error at line 2 of following program.Please any one help me to create M-Block for histogram.
- Linear regression on a semi-log scale
- Adding India boundary to a figure
Best Answer