Are you convert matlab code to visual basic code form for me, please?

4 次查看(过去 30 天)
clc
clear
A=input( 'how many fixed suport?')
B=input( 'how many pinned support or roller supoport? ')
C=input( 'how many link support or elastic support? ')
for i=1:C
d=input( 'if link support is right enter(1)else enter(2)')
D(i)=d
end
E=input( 'how many are there discontinuity in member?')
R=2*A+B
for i=1:C
if D(i)==1
R=R+2
else
R=R+1
end
end
n=R-(2+E)
disp 'n';disp (n)
if n==0
disp 'structure is assignable'
end
if n>0
disp 'structure is unlimited'
end
if n<0
disp 'structure is unlimited and astatic'
end
  1 个评论
saleh zarei
saleh zarei 2015-5-30
clc
clear
A=input( 'how many fixed suport?')
B=input( 'how many pinned support or roller supoport? ')
C=input( 'how many link support or elastic support? ')
for i=1:C
d=input( 'if link support is right enter(1)else enter(2)')
D(i)=d
end
E=input( 'how many are there discontinuity in member?')
R=2*A+B
for i=1:C
if D(i)==1
R=R+2
else
R=R+1
end
end
n=R-(2+E)
disp 'n';disp (n)
if n==0
disp 'structure is assignable'
end
if n>0
disp 'structure is unlimited'
end
if n<0
disp 'structure is unlimited and astatic'
end

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2015-5-30
Ignore the
clc
clear
The rest is mostly working with scalars, with D being the only vector. It should be simple to convert to Visual Basic for anyone who knows a small bit of Visual Basic. See for example VBA For loop
  2 个评论
Walter Roberson
Walter Roberson 2015-5-31
If it doesn't work, keep in mind how much you paid for it.
Module WalterRoberson
Sub Main()
Console.WriteLine("how many fixed support?")
Dim A as Integer = CInt(Console.ReadLine())
Console.WriteLine("how many pinned support or roller supoport? ")
Dim B as Integer = CInt(Console.ReadLine())
Console.WriteLine("how many link support or elastic support? ")
Dim C as Integer = CInt(Console.ReadLine())
Dim D() as Integer
For i as Integer = 0 To C-1
Console.WriteLine("if link support is right enter(1)else enter(2)")
D(i) = Cint(Console.ReadLine())
Next
Console.WriteLine("how many are there discontinuity in member?")
Dim E as Integer = CInt(Console.ReadLine())
Dim R as Integer = 2 * A + B
For i as Integer = 0 To C-1
If D(i) = 1 Then R = R + 2 Else R = R + 1
Next
Dim n as Integer = R - (2+E)
Console.WriteLine("n")
Console.WriteLine(n)
If n = 0 Then Console.WriteLine("Structure is assignable")
If n > 0 Then Console.WriteLine("structure is unlimited")
If n < 0 Then Console.WriteLine("structure is unlimited and astatic")
End Sub
End Module

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Signal Integrity Kits for Industry Standards 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by