what is wrong in my square wave code it isnt running

clc;
clear vars;
close all;
a=[1,1,1,1,0,0,0,0];
fs=10;
tiv=1/fs;
t=0:tiv:(3-tiv);
plot(t,a,'*');
axis([0 3 -0.5 1.5]);
xlabel('sec.');
title('square wave samples');

 채택된 답변

Alan Stevens
Alan Stevens 2020년 7월 23일

0 개 추천

You have 30 values of t and only 8 values of a. You need to have the same number of each.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Least Squares에 대해 자세히 알아보기

태그

질문:

2020년 7월 23일

답변:

2020년 7월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by