Question

The following code must be written in matlab How to convert a 4d unit8 matrix of...

The following code must be written in matlab

How to convert a 4d unit8 matrix of size

28 28 1 50000

in Matlab to a matrix of size 784*5000

Give an example that clearly solves this issue. Thanks

Homework Answers

Answer #1

The problem here is either the first matrix has to be 28*28*1*5000 or the second matrix has to be 784*5000*10 because without these changes the sizes of the matrices are different.

So, I used two matrices to demonstrate the 2 cases.

a1 is of shape 28*28*1*5000

b1 is of shape 784*5000

a2 is of shape 28*28*1*50000

b2 is of shape 784*5000*10

CODE :

clear all; close all; clc;

a1 = ones(28,28,1,5000,'uint8');
b1 = reshape(a1,784,5000);

a2 = ones(28,28,1,50000,'uint8');
b2 = reshape(a2,784,5000,10);

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
The following code must be written in Matlab I want to print the following in Matlab...
The following code must be written in Matlab I want to print the following in Matlab (x1,x2, x3, ....xn) = (0.33333, 0.33333, 0.33333,....) That is for n variables . The whole thing should be on the same line. I need to use fprintf and write out the coordinates with 5 decimal places of variable xn = (0.33333, 0.33333, 0.33333,....) Thanks!
The following code must be written in matlab. I have a list of inidices say L...
The following code must be written in matlab. I have a list of inidices say L = [1,2,5,10,6,7,] I want to loop through indices in a for loop from i=1:n , n=100 but I must skip all indices that are not in the list L How can I do this if I am not allowed to use the ismember function. Thankse
This is a written assignment that you must conduct exploratory research on how the government internalizes...
This is a written assignment that you must conduct exploratory research on how the government internalizes negative externality (you only need one market or one product or one activity). Recall negative externalities occur in many markets; for example, oil production, manufacturing, transportation, and smoking, etc. Please make sure that: 1. You clearly identify the market (product or activity) that causes negative externalities, which means the negative externalities must be also well defined. These could be shown with good statistics and...
Q3) The following matrix shows strategies and payoffs for two firms that must decide how to...
Q3) The following matrix shows strategies and payoffs for two firms that must decide how to price. (5 Points) Firm 1 Firm 2 Price High Price Low Price High 500, 500 -100, 400 Price Low 400, -100 250, 250 What is the Nash Equilibrium of this game? Q4) Use the marginal of product of labor to illustrate graphically the impact of an increase in immigration on employment and wages. (10 Points)
would someone kindly convert the following C code to java? thanks so much # include <stdio.h>...
would someone kindly convert the following C code to java? thanks so much # include <stdio.h> int main(void) { int changeOwed; int check; char invisibleChar; int count = 0; int numQ=0, numD=0, numN=0, numP=0; do{ printf("How much change is owed (in cents)?\n"); check = scanf("%d", &changeOwed); // returns 1 if the input is a number and returns 0 otherwise //Get's rid of any extra invisible characters if the input is a char/String do{ scanf("%c",&invisibleChar); }while(invisibleChar != '\n'); }while(check == 0...
Mattel Responds to Ethical Challenges Business Ethics This case was written by Debbie Thorne, John Fraedrich,...
Mattel Responds to Ethical Challenges Business Ethics This case was written by Debbie Thorne, John Fraedrich, O. C. Ferrell, and Jennifer Jackson, with the editorial assistance of Jennifer Sawayda. This case was developed for classroom discussion rather than to illustrate either effective or ineffective handling of an administrative, ethical, or legal discussion by management. All sources used for this case were obtained through publicly available material. Mattel, Inc. is a world leader in the design, manufacture, and marketing of family...
What are 4 key things you learned about the topic from reading their paper? How does...
What are 4 key things you learned about the topic from reading their paper? How does the topic relate to you and your current or past job? Critique the paper in terms of the organization and quality. Team 3 answer questions above. Part I In today’s world we see fear among people when dealing with sexual harassment. This leads to people not reporting sexual harassment. A misconception about sexual harassment is that it’s only about touching and forcing other people...
QUESTION 1 Which one of the following would NOT be necessary for an offer to have...
QUESTION 1 Which one of the following would NOT be necessary for an offer to have legal standing? A. The language must reflect the intent to become a party to a contract. B. All of the conditions under which the offer would be terminated must be identified. C. All the significant terms and/or conditions must be contained in the offer. D. The offer must be effectively communicated to the other party. 3 points    QUESTION 2 Which one of the...
a)How is it possible to determine if CaCO3 is Cl- free after synthesis? b)How can the...
a)How is it possible to determine if CaCO3 is Cl- free after synthesis? b)How can the Cl- ions be remove from CaCO3 after synthesis? I should answer the questions from the following experiment but if you know the answer and you are sure, yo do not need to read experiment. Please answer correctly because i hav no chance to make wrong :(((( Physical and Chemical Properties of Pure Substances Objective The aim of today’s experiment is to learn handling chemicals...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary rivals? How will the acquisition of Reebok by Adidas impact the structure of the athletic shoe industry? Is this likely to be favorable or unfavorable for New Balance? 2- What issues does New Balance management need to address? 3-What recommendations would you make to New Balance Management? What does New Balance need to do to continue to be successful? Should management continue to invest...