필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

case of two mappings

조회 수: 1 (최근 30일)
hang dong
hang dong 2019년 5월 21일
마감: MATLAB Answer Bot 2021년 8월 20일
Hi everyone! I am having difficulty in the combination of the two mappings, I have tried many times but still have not found a way to build the program. hope everyone help me. thank you very much.
  댓글 수: 1
Rik
Rik 2019년 5월 21일
Have a read here and here. It will greatly improve your chances of getting an answer.
What do you mean exactly by mappings? Please provide a small example input and output to illustrate what you mean. And what have you tried so far?

답변 (3개)

Walter Roberson
Walter Roberson 2019년 5월 21일
%mapping #1: x -> x^2
%mapping #2: x -> x/2 + 1
mapping1 = @(x) x.^2;
mapping2 = @(x) x/2 + 1;
map1_2 = @(x) mapping2(mapping1(x));
fplot(map1_2, [-5 5])

hang dong
hang dong 2019년 5월 22일
mapping1: permutation [0 1 3 2]
mapping2: permutation [0 3 2 1]
The combination of these two mappings will be a permutation I know how to calculate it on writing paper, I have trouble doing it on matlab

James Tursa
James Tursa 2019년 5월 22일
Not sure which one is first, but maybe one of these is what you want?
>> mapping1 = [0 1 3 2]
mapping1 =
0 1 3 2
>> mapping2 = [0 3 2 1]
mapping2 =
0 3 2 1
>> mapping1(mapping2+1)
ans =
0 2 3 1
>> mapping2(mapping1+1)
ans =
0 3 1 2
  댓글 수: 1
hang dong
hang dong 2019년 5월 22일
thank you very much!

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by