Filter löschen
Filter löschen

loading info from one code into another

4 Ansichten (letzte 30 Tage)
Shane Gibbs
Shane Gibbs am 28 Feb. 2019
Beantwortet: Star Strider am 28 Feb. 2019
Hello! I am trying to create a game , and am having a little bit of trouble.
I have stored data for some characters that I would like to have in the game.
The issue is that I cannot seem to load said data into the story game mode.
for example...
File 1:
classdef Brute
properties
EnemyCall = 'Brute'
EnemyHealth = 20
EnemyAttack= 10
EnemyEvasion = 5
File 2:
classdef Human
properties
EnemyCall = 'Human'
EnemyHealth = 10
EnemyAttack = 15
Enemy Evasion = 25
From there, I wanted to load one of the two files into another file, and have their stats be transferred over as well.
I have only started using Matlab for about 4 months, so I am not very experienced at all. If you could make it simple, that would be great! If not, Ill try it out, but it may not be successful.
Thank you!

Antworten (1)

Star Strider
Star Strider am 28 Feb. 2019
Your best option is likely to use one or more ‘.mat’ files. See the documentation discussion on Save and Load Workspace Variables (link) for an introduction to them and their use.

Kategorien

Mehr zu Conway's Game of Life finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by