Write a function that returns the depth of the input a

Assignment Help Computer Engineering
Reference no: EM132171570

Using Matlab

Cells can be placed inside cells, creating complex nested structures to store information.

Write a function celldepth(A, unused) that returns the depth of the input A (the second input unused should be part of your function definition, but it is not unused in calculation of the depth).

Depth of a cell array is defined as the maximum of the depths of its contents plus 1.

The depth of non-cell data is considered zero. You may assume that the input will not have a cell depth greater than 100.

>> celldepth( {1 [2 3]}, 0 ) ans = 1 >> celldepth( {1 {2 3}}, 0 ) ans = 2

NOTE: Because of a limitation in the server, you cannot recursively call your main function. If you want to use a recursive solution, then define your solution as a subfunction and you'll be able to call your subfunction recursively. e.g.,:

function depth = celldepth(a,unused) % The main function does nothing but calls the subfunction celldepth2. depth = celldepth2(a); function [depth] = celldepth2(a) %... You can now call celldepth2 within celldepth2.

Reference no: EM132171570

Questions Cloud

How would you go about advising the company : To reduce the dependence on foreign oil supplies, the government is thinking of increasing the federal taxes on gasoline. Suppose the Ford Motor Company.
Find the probabilities for events occurring for z : To receive FULL credit, you must provide the correct response, the full Matlab syntax used to produce the answer, and an appropriate sketch.
What would be your recommendations : Suppose the president of the United States is thinking of imposing tariffs on imported steel to protect the interests of the domestic steel industry.
Generate a table of conversions from celsius to rankine : Generate a table of conversions from Celsius to Rankine. Allow the user to enter the starting temperature and the increment between lines.
Write a function that returns the depth of the input a : Write a function celldepth(A, unused) that returns the depth of the input A (the second input unused should be part of your function definition.
Analyse the key elements of the marketing function : Critically analyse and evaluate the key elements of the marketing function and how they interrelate with other functional units - Marketing in KFC
What is the importance of change management : What is the importance of change management? Describe the role of a change manager?
Write a function that accepts a variable number of input : Write a function that accepts a variable number of input values and returns the sorted values as an array.
What are the seven objectives of the ondcp : What are the seven objectives of the ONDCP? What is the National Southwest Border Counternarcotics Strategy? What are its objectives?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Part-1task 1 the first task in this assignment tests your

part-1task 1 the first task in this assignment tests your knowledge of what is required to build a fully-functioning

  Identify the antivirus software that you currently use

Identify the antivirus software that you currently use or would prefer to use in order to protect your organization or personal system(s).

  Display two messages below the button if otherwise

Display two textboxes and a button. The user is expected to input a student's A-number into the first textbox and input a name into the second textbox.

  Design a complex abstract type

Design a Complex abstract type, whose values are complex numbers. Equip your abstract type with operations such as magnitude and complex addition.

  Describe each of the six stages of the employee life cycle

Describe each of the six stages of the employee life cycle using your own words.

  Questionassume that you set up a data base for a credit

questionassume that you set up a data base for a credit card company and after initial analysis you have come up with

  Web designers use cookies and session variables to

discuss how an object must be an expert on certain sets of information.nbspvisit a business online web presence.

  Questionconsider following statements-double num1 num2

questionconsider following statements-double num1 num2 num3int int1 int2 int3double valuenum1 5.0 num2 6.0 num3

  Design a sequential circuit whose state diagram is given

Design a sequential circuit whose state diagram is given in Fig. using a 3-bit register and a 16 x 4 ROM.

  Implement preorder using the binarytreeiterator class

Implement a PreOrder, InOrder or PostOrderBinaryTreeIterator using the BinaryTreeIterator class as the base class of the class you create

  Creating dynamic websites and web-based applications

Creating Dynamic Websites and Web-based Applications - You can build any type of website you choose. For example a portfolio site, brochure site, information

  Identify the product that would be best for the firm

A specialty software development firm is planning to offer one of four new software products and wishes to maximize profit, minimize risk, and increase market.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd