clear
echo on
syms y k
g=(2*k-1)*y^(k-1)-((1-y^(k-1))/(1-y));
s=input('k=');
r=subs(g,k,s);
d=solve(r,y);
d1=double(d);
a=d1>0&imag(d1)==0;
disp(d1(a))
hi,I want to solve this problem g=(2*k-1)*y^(k-1)-((1-y^(k-1))/(1-y));
with different k and compute real and positive y so I wrote this problem in MATLAB :
clear
clc
syms y k
g=(2*k-1)*y^(k-1)-((1-y^(k-1))/(1-y));
s=input('k=');
r=subs(g,k,s);
d=solve(r,y)
for...