Rank: 1464 based on 93 downloads (last 30 days) and 4 files submitted
photo

Grzegorz Knor

E-mail
Company/University
IPPT PAN
Lat/Long
52.207867, 20.980518

Personal Profile:

My personal website: http://gknor.keep.pl/
My profile on Polish matlab forum: http://matlab.pl/profile.php?mode=viewprofile&u=9146

Professional Interests:
Finite element method, signal processing

 

Watch this Author's files

 

Files Posted by Grzegorz View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
09 Oct 2010 Screenshot StemBar Function similar to the matlab stem3 but drawing bars instead of lines with markers. Author: Grzegorz Knor stem3, bar3, plot3 21 6
  • 3.5
3.5 | 3 ratings
09 Oct 2010 Screenshot Lissajous curve LISSAJOUS - a simple example of 2D line plot in Matlab, and creating a GUI without GUIDE. Author: Grzegorz Knor plot, gui, demo 25 0
29 Sep 2010 waitinput WAITINPUT Prompt for user input, but no longer than t seconds. Author: Grzegorz Knor input, getkey, keypress, keyboard 28 2
  • 5.0
5.0 | 2 ratings
25 Aug 2010 Screenshot Wprowadzenie do Simulinka (Introduction to Simulink in Polish) Wprowadzenie do Simulinka w formie krótkiego kursu w języku polskim. Author: Grzegorz Knor simulink, kurs simulinka 19 1
Comments and Ratings by Grzegorz View all
Updated File Comments Rating
02 Apr 2013 matlab2tikz A script to convert MATLAB/Octave into TikZ figures for easy and consistent inclusion into LaTeX. Author: Nico Schlömer

13 Mar 2012 Image Resize Another function to resize an image. Author: Yan Maraden Sinaga

Please pre-allocate the img_out variable to speed up your code.

05 Aug 2011 waitinput WAITINPUT Prompt for user input, but no longer than t seconds. Author: Grzegorz Knor

In line 37 should be:
error('The third argument to WAITINPUT must be ''s'', or ''d''.')

Instead of:
error('The second argument to WAITINPUT must be ''s'', or ''d''.')

28 Jan 2011 Gaussian Quadrature for Triangles Compute Gauss nodes and weights for a triangle Author: Greg von Winckel

Ok, it was my mistake, should be:
f=@(x,y) x.^2.*exp(y);
instead of:
f=@(x,y) x^.2.*exp(y);

I wrote a function (slower) from which you can compare the results:
================================
function sol = int_tri(fun,p)
xa = min(p(:,1));
xb = median(p(:,1));
xc = max(p(:,1));
ya = p(p(:,1)==xa,2);
yb = p(p(:,1)==xb,2);
yc = p(p(:,1)==xc,2);
if length(unique(p(:,1)))==3 % two triangles
ys = (ya-yc)/(xa-xc)*xb + (xa*yc-xc*ya)/(xa-xc);
y = [([xa 1; xb 1]\[ya; min(yb,ys)])' % bottom line 1
([xa 1; xb 1]\[ya; max(yb,ys)])' % top line 1
([xb 1; xc 1]\[min(yb,ys); yc])' % bottom line 2
([xb 1; xc 1]\[max(yb,ys); yc])'];% top line 2
y_lo1 = @(x)y(1,1)*x+y(1,2);
y_lo2 = @(x)y(3,1)*x+y(3,2);
y_hi1 = @(x)y(2,1)*x+y(2,2);
y_hi2 = @(x)y(4,1)*x+y(4,2);
fh1 = @(x) quadl(@(y)fun(x,y),y_lo1(x), y_hi1(x));
fh2 = @(x) quadl(@(y)fun(x,y),y_lo2(x), y_hi2(x));
sol = quadl(@(X)arrayfun(fh1,X), xa,xb) + quadl(@(X)arrayfun(fh2,X), xb,xc);
else % one triangle
y = [([xa 1;xc 1]\[min(ya); min(yc)])'
([xa 1;xc 1]\[max(ya); max(yc)])'];
y_lo1 = @(x)y(1,1)*x+y(1,2);
y_hi1 = @(x)y(2,1)*x+y(2,2);
fh1 = @(x) quadl(@(y)fun(x,y),y_lo1(x), y_hi1(x));
sol = quadl(@(X)arrayfun(fh1,X), xa,xc);
end

06 Jan 2011 XMas Tree Draws a xmas tree with decorations Author: Marc Lätzel

I created video based on your code:
http://www.youtube.com/watch?v=TIrzjTmAyOs

Comments and Ratings on Grzegorz's Files View all
Updated File Comment by Comments Rating
01 Sep 2011 waitinput WAITINPUT Prompt for user input, but no longer than t seconds. Author: Grzegorz Knor mohammad

thanks a lot. works perfect!!!

01 Sep 2011 waitinput WAITINPUT Prompt for user input, but no longer than t seconds. Author: Grzegorz Knor mohammad

01 Sep 2011 waitinput WAITINPUT Prompt for user input, but no longer than t seconds. Author: Grzegorz Knor mohammad

05 Aug 2011 waitinput WAITINPUT Prompt for user input, but no longer than t seconds. Author: Grzegorz Knor Knor, Grzegorz

In line 37 should be:
error('The third argument to WAITINPUT must be ''s'', or ''d''.')

Instead of:
error('The second argument to WAITINPUT must be ''s'', or ''d''.')

22 Dec 2010 StemBar Function similar to the matlab stem3 but drawing bars instead of lines with markers. Author: Grzegorz Knor Jiaqi

now it works. I need to run stembar again with color information.
%%%%%%%%%%
x=[1 3 2 1 3]';
y=[1 1 2 3 3]';
z=[8.6 6 11.1 14.1 12.4]';
h = stembar(x,y,z); % 5 bars, 30 faces
zdata = ones(length(h),4); % each face has 4 vertices
% specify the color map
k=0;
for i=1:length(h)/6
ztop = get(h(i*6),'Zdata');
ztop = ztop';
for j=1:6
zdata(6*(i-1)+j,:)=ztop;
end
end
% now give the color specification
% and run 'stembar' again
zdata = zdata';
h=stembar(x,y,z,zdata);

colormap cool
colorbar
%%%%%%%%%%%%
It is strange that it doesn't work when I use set(h,'Cdata',zdata),
maybe it's a bug in the command 'fill3'.
however set(h,'facealpha',0.5) works
and set(h,'edgecolor','b') also works.

Contact us