Two differente program to write in the same place

2 次查看(过去 30 天)
Dear, I have a question about write data in the same file using two different program.
I have a program call main.m and other call transfer.m
Each program find different results
The first program (main) find 19 line and 6 column (19x6) Double
The second program (transfer) find 19 line and 36 columns (19x36) Double
I would like match these two program to write a program, xx, with 19 lines and 42 columns (19x42) Double. 42 columns because 6 columns of main program + 36 columns of transfer program.
That is, the first line of the two program (main and transfer) is the first line of xx program. The columns 1 until 6 of xx program is the columns 1 until 6 of main program. the columns 7 until 42 of xx program is the columns 1 until 36 of program transfer.
The second line of two program (main and transfer) is the second line of xx program. The columns 1 until 6 of xx program is the columns 1 until 6 of main program. the columns 7 until 42 of xx program is the columns 1 until 36 of program transfer.
.
.
The 19 line of two program (main and transfer) is the 19th line of xx program. The columns 1 until 6 of xx program is the columns 1 until 6 of main program. the columns 7 until 42 of xx program is the columns 1 until 36 of program transfer.
Thank you advanced

采纳的回答

Rik
Rik 2019-4-7
编辑:Rik 2019-4-7
This is just a simple concatenation:
function output=xx
output=[main transfer];
end
function output=main
output=rand(19,6);
end
function output=transfer
output=rand(19,36);
end
You should consider a tutorial like this one, and also read this page before posting your next question.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Operators and Elementary Operations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by