matrix matlab programming

Discussion in 'Programmer's Corner' started by lonelygothicsoul, Feb 1, 2010.

  1. lonelygothicsoul

    Thread Starter New Member

    Feb 1, 2010
    1
    0
    n=input('enter the number of buses');
    for a=1:n
    for b=1+a:n
    y(a,b)=input('enter the line admittance');
    y(b,a)=y(a,b);
    end
    when executed the o/p will be as folows
    enter the number of buses
    enter the admittance

    i want to modify the o/p so that program gives me the info of the element of y matrix that i feed. that is
    the o/p should be

    enter the number of buses
    (let it be 3)
    enter the line admittance 1-2
    enter the line admittance 1-3
    enter the line admittance 2-3

    please help
     
Loading...