I thought I had a really simple question but unfortunately it seems harder than expected.
The problem is the following:
First I generate a .txt file (named inputs.txt) by using another program, this inputs.txt file contains variables names and values in this way:
if necessary for the solution, they can be also be organized by columns.
Now I have to import in MATLAB this inputs.txt file assigning the name of the variable to their respective value. For example, I have to load the inputs.txt so that I'll obtain in MATLAB:
base = 10;
length = 5;
angle = 45;
hieght = 5;
I tried many different functions as "readtable", "textread", "load", "import"... I can't find a way to do that. The problem is related to the variables names because they are read as "cells" and I don't know how to convert them in variables. It is really important for me to assign the variables equal to the ones in the .txt file and I have around 50 different inputs variables in the inputs.txt file so I need a smart way to automatically do that without re-writing name variables every time.