trying to connect points from a matrix on a plot

조회 수: 2 (최근 30일)
Miguel Cano
Miguel Cano 2018년 11월 17일
답변: Cris LaPierre 2018년 11월 17일
is there a way to connect each point to each other? my script collects points from the txt file provided this is how my plot looks at the moment:plot.png
clear;
clc;
close all;
filename = input('Please provide the name of the input file:','s');
fid = fopen(filename,'r');
temp = fscanf(fid,'%f',4);
j = temp(1);
m = temp(2);
r = temp(3);
nload = temp(4);
%sanity check
if 2*j ~= (m+r)
fclose(fid);
error('This program can only solve determinate truss ');
end
temp = fscanf(fid,'%f %f',[2 j]);
XY = temp';
fclose(fid);
plotmatrix(XY(:,1),XY(:,2))

채택된 답변

Cris LaPierre
Cris LaPierre 2018년 11월 17일
The documentation might help here:
plotmatrix creates a scatter plot (markers only, no line).
Use plot instead to connect the points with a line.

추가 답변 (0개)

태그

제품


릴리스

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by