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