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

6 vues (au cours des 30 derniers jours)
saleh zarei
saleh zarei le 30 Mai 2015
Commenté : saleh zarei le 31 Mai 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
  1 commentaire
saleh zarei
saleh zarei le 30 Mai 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

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 30 Mai 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 commentaires
Walter Roberson
Walter Roberson le 31 Mai 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
saleh zarei
saleh zarei le 31 Mai 2015
tanx alot

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Signal Integrity Kits for Industry Standards dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by