Rank: 2026 based on 71 downloads (last 30 days) and 4 files submitted
photo

Paulo Silva

E-mail

Personal Profile:

Just done my Masters degree in Control and Industrial Electronics, I also have one licenciates degree in Electrical Engineering and Computer Science.

I love to use MATLAB and to help others using it, everyday I learn something new.

Currently teaching and supporting students with several projects that use MATLAB for Biomedical Imaging.

Please don't send me emails asking for code or help, I will only help the best I can here at MATLAB Answers.

Professional Interests:
Control engineering, biking, growing organic food, permaculture student (nature is my teacher)

 

Watch this Author's files

 

Files Posted by Paulo View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
26 Feb 2011 Screenshot MFileSelector Shows a list of all m files open in the editor and allows one to be selected Author: Paulo Silva files path selector 6 1
  • 4.0
4.0 | 1 rating
22 Feb 2011 Screenshot Find intersection of two lines This function accepts two lines and returns the point that the lines have in common. Author: Paulo Silva intersection lines 36 2
  • 3.5
3.5 | 4 ratings
12 Jan 2011 Screenshot LinTestPJ psychology experiment that measures how people map numbers to space Author: Paulo Silva gui psychology experi... 11 1
  • 5.0
5.0 | 1 rating
03 Dec 2010 Screenshot SpSpj Just a quick and dirty example of a GUI that starts, pauses and stops a loop Author: Paulo Silva gui 18 0
Comments and Ratings by Paulo
Updated File Comments Rating
01 Apr 2011 FIGHT TO THE DEATH AGAINST A GIANT CHICKEN An epic finalfantasy-style fight against an AI controled chicken with a dynamic interface :P Author: Emile B.

cool game

Comments and Ratings on Paulo's Files View all
Updated File Comment by Comments Rating
11 Jul 2013 Find intersection of two lines This function accepts two lines and returns the point that the lines have in common. Author: Paulo Silva Anirban

Cannot handle situation when lines intersect in an extended point.

09 Jul 2012 Find intersection of two lines This function accepts two lines and returns the point that the lines have in common. Author: Paulo Silva sur, chiranjib

19 Jan 2012 MFileSelector Shows a list of all m files open in the editor and allows one to be selected Author: Paulo Silva Lucio, Jesús

Very useful when there are a lot of opened files. Thanks a lot.

10 Jul 2011 Find intersection of two lines This function accepts two lines and returns the point that the lines have in common. Author: Paulo Silva John

Does not give accurate intersections. Specifically, at the endpoints of lines. Perhaps due to the high precision of the points chosen since "Warning: Matrix is singular to working precision" is shown. The line intersect function by Douglas Schwartz (file ID #11837) computes the intersection accurately.

An example script showing this:

%This script tests the function "lineintersect.m" by Paulo Silva. Note
%that when line1=1 and line2=2, lineintersect.m finds the correct
%intersection BUT line1=2 ad line2=1 does not.

clear all; close all;

%4 equidistant points on perimeter of circle of radius 100. Placed at 45,
%135, 225, 315 degrees and converted to XY crds using pol2cart function. Row #1 is X-crds, Row #2 is Y-crds
ptsXY=[70.7106781186548,-70.7106781186547,-70.7106781186548;70.7106781186547,70.7106781186548,-70.7106781186547];

%plots points as red stars
hold on;
plot(ptsXY(1,:),ptsXY(2,:),'*','color','red');

%"Lines" describes how the points are connected. Here, pt 1 and pt 3 are connected. And pt 2 and pt 3 are connected.
Lines=[1,2;3,3];

%plot lines and label lines with line IDs
for ii=1:size(Lines,2)
plot(ptsXY(1,Lines(:,ii)),ptsXY(2,Lines(:,ii)));
text(linspace(ptsXY(1,Lines(1,ii)),ptsXY(1,Lines(2,ii)),10),linspace(ptsXY(2,Lines(1,ii)),ptsXY(2,Lines(2,ii)),10),int2str(ii),'Color','black','FontWeight','normal');
end

%choose two lines to test. Note that line1=1 and line2=2 finds the correct
%intersection BUT line1=2 ad line2=1 does not.
line1=2;
line2=1;

%extract XY crds
l1_XY=[ptsXY(:,Lines(1,line1)) ptsXY(:,Lines(2,line1))]; %-each line is defined by 4 coordinates: 2 X- and 2 Y-crds
l2_XY=[ptsXY(:,Lines(1,line2)) ptsXY(:,Lines(2,line2))]; %/

%look for intersection and plot intersection
[intxX,intxY]=lineintersect([l1_XY(:,1)' l1_XY(:,2)'],[l2_XY(:,1)' l2_XY(:,2)']);
plot(intxX,intxY,'ro','MarkerFaceColor','g','LineWidth',2) %this will mark the intersection point with red 'o'

07 Apr 2011 Find intersection of two lines This function accepts two lines and returns the point that the lines have in common. Author: Paulo Silva HAMDI, Maher

Contact us