copy element of matrix to matrix

조회 수: 9 (최근 30일)
suraj singh
suraj singh 2018년 3월 25일
댓글: Paulo Fonteles 2022년 7월 5일
I have a matrix x of 20x95 elements are in double. I want to copy element of x to y. Please provide code.
  댓글 수: 2
KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 3월 25일
Clarify your question in more detail.
suraj singh
suraj singh 2018년 3월 25일
Sir, I want to copy all elements of one matrix to other matrix and number of rows and column are 20x95 in the input matrix. Output matrix should be 20x95.

댓글을 달려면 로그인하십시오.

답변 (2개)

Birdman
Birdman 2018년 3월 25일
Isn't it simply
y=x
?

KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 3월 25일
%Suppose A is your Input matrix, B is your output matrix
%if matrix is already generated within code, no need to input statement-next line
A=input('Enter The Matrix Elements');
B=A;
disp(B);
%Now Matrix B having same elements as Matrix A
  댓글 수: 1
Paulo Fonteles
Paulo Fonteles 2022년 7월 5일
that would link matrix A and B... so every change in B would affect A

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by