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

13 views (last 30 days)
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 Comment
saleh zarei
saleh zarei on 30 May 2015
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

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 30 May 2015
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 Comments
Walter Roberson
Walter Roberson on 31 May 2015
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

Sign in to comment.

More Answers (0)

Categories

Find more on Data Type Conversion in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!