Skip to main content

Posts

Showing posts with the label read

save append and read data from a file using Matlab

Problem Create a 4x4 random matrix and save it in a file. Now create a 4x4 matrix and append the new matrix to the file. Finally read the data from the file and display on the command window. Solution In this program we will create a matix using the rand function and then save it to the file. Again we will create a matrix and append the matrix to the file. Finally we will read the data from the file. In this program we will only use the command prompt window to accomplish the task. First of all head on to the program section to get insight into what is happening, then you can refer to the explanation section to get detailed explanation of the program section. Some of the concepts used to solve this post are as follows: 1) Matrices in Matlab 2) rand function in Matlab 3) Save in Matlab 4) Append in Matlab 5) Load in matlab 6) variables in matlab 7) matrix In Mathematics Program >> mat = rand ( 4 , 4 ) mat = 0.7094 0.6551 0.9597 0.7513 ...