Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please write in Matlab program. my_reshape Write a function my_reshape that returns a m x n matrix B, whose elements are taken columnwise from row
Please write in Matlab program.
my_reshape Write a function my_reshape that returns a m x n matrix B, whose elements are taken columnwise from row vector A of length m xn For example if, A [146378] and m 2, and n = 3, then Your function must return -1 if A does not havem x n elements. Following is the signature of the function function B-my_reshape (A,m,n) Inputs: A- a row vector of length m x n Output B- a matrix of size m x n Note: This function must use loops rather than MATLAB built-in functions such as reshape, fliplr, flipud. Code to call your function 1 A [1 4 6 3 7 81 2 m 2; B-my-reshape (A , m , n) 5 4Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started