Asked by:
Convert a Matlab cod to Visual Basic 2010

Hello,
can you help me and convert this Matlab cod to Visual Basic 2010.
y12=10j*20;
y13=10j*30;
y23=16j*32;
y33=y13+y23;
V1=1.05+j*0;
%format long
iter =0;
S2=4.0j*2.5;
P3 = 2;
V2=1+j*0;
Vm3=1.04;
V3=1.04+j*0;
for
I=1:10;
iter=iter+1
E2 = V2;
E3=V3;
V2 = (conj(S2)/conj(V2)+y12*V1+y23*V3)/(y12+y23)
DV2 = V2E2
Q3 = imag(conj(V3)*(y33*V3y13*V1y23*V2))
S3 = P3 +j*Q3;
Vc3 = (conj(S3)/conj(V3)+y13*V1+y23*V2)/(y13+y23)
Vi3 = imag(Vc3);
Vr3= sqrt(Vm3^2  Vi3^2);
V3 = Vr3 + j*Vi3
DV3=V3E3
end
the result:
iter =
10
V2 =0.9706  0.0457i
DV2 =3.3824e07  2.7125e06i
Q3 =1.4617
Vc3 =1.0400  0.0091i
V3 =1.0400  0.0091i
DV3 =1.8650e08  2.1428e06i
Question
All replies

Perhaps you could use Matlab coder to convert Matlab code from Matlab to C++. Then download Tangible Free Product Editions C++ to VB converter and convert the code that way.
Please BEWARE that I have NO EXPERIENCE and NO EXPERTISE and probably onset of DEMENTIA which may affect my answers! Also, I've been told by an expert, that when you post an image it clutters up the thread and mysteriously, over time, the link to the image will somehow become "unstable" or something to that effect. :) I can only surmise that is due to Global Warming of the threads.

Hello,
can you help me and convert this Matlab cod to Visual Basic 2010.
This question has been asked here:
http://social.msdn.microsoft.com/Forums/vstudio/enUS/924c7550ce6a444c882308275cfa7d75/visualbasic2010?forum=vbgeneralIf a different thread is now required then you should indicate what additional information you need about the solutions already posted there.

In fact,I have difficulty to convert this part.
V2 = (conj(S2)/conj(V2)+y12*V1+y23*V3)/(y12+y23)
DV2 = V2E2
Q3 = imag(conj(V3)*(y33*V3y13*V1y23*V2))
S3 = P3 +j*Q3;
Vc3 = (conj(S3)/conj(V3)+y13*V1+y23*V2)/(y13+y23)
Vi3 = imag(Vc3);
Vr3= sqrt(Vm3^2  Vi3^2);
V3 = Vr3 + j*Vi3
DV3=V3E3


Hello,
could you please find a Visual Basic Code from this Matlab Code.
let's assume that
Pgg=[ 35.0907 64.1317 52.4767]
cost function=[200 7 0.008
180 6.3 0.009
140 6.8 0.007]
if
exist('Pgg')~=1
Pgg=input(
'Enter the scheduled real power gen. in row matrix ');
else
,end
if
exist('cost')~=1
cost = input(
'Enter the cost function matrix ');
else
, end
ngg = length(cost(:,1));
Pmt = [ones(1,ngg); Pgg; Pgg.^2];
for
ii = 1:ngg
costv(ii) = cost(ii,:)*Pmt(:,ii);
end
totalcost=sum(costv);
fprintf(
'\nTotal generation cost = % 10.2f $/h \n', totalcost)
 Merged by Franklin ChenMicrosoft employee, Moderator Monday, March 24, 2014 8:58 AM Duplicate


You should try Matlabs converter that converts Matlab code to C++. Then convert the C++ code to Visual Basic using a C++ to Visual Basic converter.
I believe I already mentioned this in another post about Matlab code by you  Convert a Matlab cod to Visual Basic 2010  or did you have an inability to do that on your own for some reason?
Or get the documentation from Matlabs website and convert all the code yourself  MATLAB Documentation  once you learn what your MATLAB code is.
Why would you think somebody could convert Matlab code to Visual Basic code in a Visual Basic forum? Also this isn't a forum for converting code from some language to Visual Basic.
Please BEWARE that I have NO EXPERIENCE and NO EXPERTISE and probably onset of DEMENTIA which may affect my answers! Also, I've been told by an expert, that when you post an image it clutters up the thread and mysteriously, over time, the link to the image will somehow become "unstable" or something to that effect. :) I can only surmise that is due to Global Warming of the threads.
 Edited by Mr. Monkeyboy Saturday, March 22, 2014 5:32 PM 5555