Two differente program to write in the same place

2 vues (au cours des 30 derniers jours)
Leonardo Barbosa Torres dos Santos
Modifié(e) : Rik le 7 Avr 2019
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

Réponse acceptée

Rik
Rik le 7 Avr 2019
Modifié(e) : Rik le 7 Avr 2019
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.

Plus de réponses (0)

Catégories

En savoir plus sur Operators and Elementary Operations dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by