Good day!
My code reads in data from a .csv file as a startup function and displays it in a table, which works fine. Although, there are a bunch of edit fields that the user fills in, and then clicks on a "Save Data" button that shows the new data on the table, but should also save it to the csv file. When I run the code and try it out, an error message pops up in the matlab command window saying that permission is denied for the csv file, or that it can simply not find it (but it is saved in my matlab folder on my computer). ANY help on this would be much appreciated!! Thank you!
Below is the code I have for it so far:
function SaveDataButtonPushed(app, event) name = app.MatName.Value; e1 = app.LongElasMod.Value; e2 = app.TransElasMod.Value; g12 = app.ShearMod.Value; V12 = app.PoissonRatio.Value; xp = app.LongComp.Value; x = app.LongTens.Value; yp = app.TransComp.Value; y = app.TransTens.Value; s = app.UltShear.Value; nr = {name e1 e2 g12 V12 xp x yp y s}; app.UITable.Data = [app.t;nr]; app.t = app.UITable.Data; Tnew = [app.t;nr]; size(Tnew); csvwrite('StrengthsMaterialsList.csv', Tnew); end
Best Answer