MATLAB: How can i get in place of %d is i values for each iteration of e

newer duplicate questionwhile running i am running this code i getting this error "error using input the second argument to input must be 's'." plz help me

num_nod=input('num_nod = ')
for e=1:2*num_nod
force(e,1)=input('applied forces at node %d:',e);
end
[MOVED from tags] while running i am running this code i getting this error "error using input the second argument to input must be 's'." plz help me

Best Answer

  • num_nod=input('num_nod = ')
    for e = 1:2*num_nod
    force(e,1) = input(sprintf('applied forces at node %d: ', e));
    end