Here is what is in the file:
x1=input('enter value for x1 : ');
x2=input('enter value for x2 : ');
n1=input('enter time interval n1 : ');
n2=input('enter time interval n2 : ');
subplot(2,2,1);
stem(n1,x1);
title('signal1')
subplot(2,2,2);
stem(n2,x2);
title('signal2')
sigadd(x1,n1,x2,n2)
How do you get past line 3?:
clear all
j=input('Enter the value of "N": ');
if ischar(i)==1%Exception handling for char input
fprintf('Please enter an integer value')
break;
end
Start with a matrix of zeros, change all the values to 1 individually through a nested for loop, then use another nested for loop to change some of them back to zeros.
The author at least deserves credit for preallocating memory.
This is why so much effort was put into implementing JIT.
Here is the entirety of what is in this file:
function [G]=bandmatrix(n,k1,k2)
G=zeros(n,n);
for i=1:n
for j=1:n
G(i,j)=1;
end
end
for i=1:n
for j=1:n
if (j<i-k1) G(i,j)=0;
end
if(j>i+k2) G(i,j)=0;
end
end
end
17 Jun 2010
Insertion Sort
Insertion sort is a simple sorting algorithm in which the sorted array is built one entry at a time.
Author: iso fault
Is this a homework solution or does the author not know about the function sort or does the author think that this function is better in some way than the built in function sort?