Skip to main content

Posts

Standalone App: Time series plotting with Tailor-made customization

Recent posts

MATLAB: extract Lat Long from google in a loop | The Web Scraper

Function_Google_MatLab_Lat_Long function [LatLong]=Function_Google_MatLab_Lat_Long(var) a=[var '+' 'lat' '+' 'long' ]; a=regexprep(a, ' ' , '%20' ); urlp=[ 'http://www.google.co.in/search?hl=en&q=' a]; txt=urlread(urlp); f=strfind(txt, 'gl=in&amp;sa=X&amp;ll=' ); dt=txt(f:f+100); x = regexp(dt, '-?\d+\.?\d*|-?\d*\.?\d+' , 'match' ); for i=1:2 if ~isempty(x) k{1,i} =x{1,i}; else f=strfind(txt, '</li></ul></div></div></div><span class="st">' ); dt2=txt(f:f+1000); x2 = regexp(dt2, '-?\d+\.?\d*|-?\d*\.?\d+' , 'match' ); k{1,i} =x2{1,i}; disp( 'Check Results...!!' ) end end LatLong=str2double(k); end Demo_test city={ 'Mettuppalaiyam' ; 'Udagamandalam' ; 'Mettur' ; 'Udagamandalam' ; '...

MATLAB: add progress bar in your code

Function_Progress function Function_Progress(ti,day,len) %ti = cputime; put above for loop figure(1000) per=min(1+day*100/len,100);per2=day*100/len; b2 = barh(100, 'FaceColor' ,[0.8,0.8,0.8]);b2.BarWidth= 0.11; hold on ;clr = interp1(linspace(1,101,100),winter(100),per); b = barh(per, 'FaceColor' ,clr); xlim([0 100]); box on ;b.BarWidth= 0.1; set(gca, 'YTick' ,[]);set(gca, 'XTickLabel' ,[]);set(gca, 'XTick' ,[]); txt1 = sprintf( 'complete = %.0f %%' ,per2);t=text(34,1.2,txt1);t.FontSize = 14; e = (cputime-ti);txt2 = sprintf( 'Time Taken: %.0f:%.0f' ,e/60,rem(e,60));t2=text(67,0.55,txt2);t2.FontSize = 10; c = clock;txt3 = sprintf( 'Time Now: %.0f:%.0f' ,c(4),c(5));t3=text(0.5,0.55,txt3);t3.FontSize = 10; hold off ; getframe(gcf); % hold on; b3= barh(100,'g');b3.BarWidth= 0.1; put below for loop end Run_progress t = cputime; for i=1:100 Function_Progress(t,...

Avoid 'FOR LOOP' | Kill the Devil

Kill the Devil: Avoid 'FOR LOOP' for faster calculation Untitled4 Contents Matrixwise Average Calculation Creating Matrix with row wise sum to 1 Matrixwise Average Calculation Data Generation for j=1:5 C{j,1}=rand(3,7); end % Calculation ChangeDim=cat(3,C{:}); % Creating higher dimensional matrix AMW=mean(ChangeDim,3); % Average Matrix Wise Creating Matrix with row wise sum to 1 p=rand(7,3); % Data Generation FM=bsxfun(@rdivide,p, sum(p,2)); % Calculation

Learning Diary | the journey begins

Platform Matlab 2016b: Commercial programming language developed by MathWorks R 3.3.2 : Open Source along with  R studio  1.0.143