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

4 visualizzazioni (ultimi 30 giorni)
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 Commento
saleh zarei
saleh zarei il 30 Mag 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

Accedi per commentare.

Risposta accettata

Walter Roberson
Walter Roberson il 30 Mag 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 Commenti
Walter Roberson
Walter Roberson il 31 Mag 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

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Signal Integrity Kits for Industry Standards in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by