Answered

how to select specific column and rows in excel

You can use readtable for import data from excel to MATLAB https://www.mathworks.com/help/matlab/import_export/read-spreadsheet...

how to select specific column and rows in excel

You can use readtable for import data from excel to MATLAB https://www.mathworks.com/help/matlab/import_export/read-spreadsheet...

3 months ago | 0

Answered

Extension change from .txt to .Z14

You can copy file as following file1='A.txt' file2=strrep(file1,'.txt','.Z14') copyfile(file1,file2)

Extension change from .txt to .Z14

You can copy file as following file1='A.txt' file2=strrep(file1,'.txt','.Z14') copyfile(file1,file2)

3 months ago | 1

| accepted

Answered

defining simulink variables through matlab srcript

You can create variables to workspace and in simulink, enable acess to base workspace. For create variables via script, let 's ...

defining simulink variables through matlab srcript

You can create variables to workspace and in simulink, enable acess to base workspace. For create variables via script, let 's ...

3 months ago | 0

Solved

Convert given decimal number to binary number.

Convert given decimal number to binary number. Example x=10, then answer must be 1010.

3 months ago

Solved

Find the longest sequence of 1's in a binary sequence.

Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...

3 months ago

Answered

I am trying to create a game where a user guesses a number between 1 and 100 using a while loop. But I am getting stuck in an infinite loop. Please help?

Let 's try y=randi(100); while (1) prompt= '\nguess a value between 1 and 100: '; x=input(prompt); if (...

I am trying to create a game where a user guesses a number between 1 and 100 using a while loop. But I am getting stuck in an infinite loop. Please help?

Let 's try y=randi(100); while (1) prompt= '\nguess a value between 1 and 100: '; x=input(prompt); if (...

3 months ago | 2

Solved

Fibonacci-Sum of Squares

Given the Fibonacci sequence defined by the following recursive relation, * F(n) = F(n-1) + F(n-2) * where F(1) = 1 and F(1)...

3 months ago

Solved

Fibonacci sequence

Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: Inpu...

3 months ago

Answered

how to change the shape of Simulink Subsystem?

you mean that change mask of subsystem block, right? If it is right, you can right click to subsystem block, select Mask -> Cre...

how to change the shape of Simulink Subsystem?

you mean that change mask of subsystem block, right? If it is right, you can right click to subsystem block, select Mask -> Cre...

3 months ago | 0

Answered

I wanted to combine these cells into a table.

Do it as following: load('matlab.mat'); out = cell2mat(new_raw(1,1)); for i=2:length(new_raw) out = horzcat(out, cell2ma...

I wanted to combine these cells into a table.

Do it as following: load('matlab.mat'); out = cell2mat(new_raw(1,1)); for i=2:length(new_raw) out = horzcat(out, cell2ma...

3 months ago | 0

| accepted

Answered

Access lower level fields in structure

Let 's try sm = table2array(cell2table(struct2cell(foo))); Wdata = [sm(:).W];

Access lower level fields in structure

Let 's try sm = table2array(cell2table(struct2cell(foo))); Wdata = [sm(:).W];

3 months ago | 0

| accepted

Answered

calling a value in a matrix

Let 's try X = [1 3 4 5]; Y = [2 6 7 8]; [max_val, idx] = max(Y); X_idx = X(idx);

calling a value in a matrix

Let 's try X = [1 3 4 5]; Y = [2 6 7 8]; [max_val, idx] = max(Y); X_idx = X(idx);

3 months ago | 1

| accepted

Answered

Getting the low and high years

Let 's try load('zyrs.mat'); out = year_SPI(find(abs(year_SPI(:,2)) >1), :);

Getting the low and high years

Let 's try load('zyrs.mat'); out = year_SPI(find(abs(year_SPI(:,2)) >1), :);

3 months ago | 0

| accepted

Answered

Problem with code reusabilty of inlined S-Function

You need to add ssSetOptions in mdlInitializeSizes(SimStruct *S) function in your C S function as following. ssSetOptions(S...

Problem with code reusabilty of inlined S-Function

You need to add ssSetOptions in mdlInitializeSizes(SimStruct *S) function in your C S function as following. ssSetOptions(S...

3 months ago | 0

| accepted

Solved

Triangle sequence

A sequence of triangles is constructed in the following way: 1) the first triangle is Pythagoras' 3-4-5 triangle 2) the s...

3 months ago

Solved

Find a Pythagorean triple

Given four different positive numbers, a, b, c and d, provided in increasing order: a < b < c < d, find if any three of them com...

3 months ago

Solved

Is this triangle right-angled?

Given any three positive numbers a, b, c, return true if the triangle with sides a, b and c is right-angled. Otherwise, return f...

3 months ago

Solved

Is this triangle right-angled?

Given three positive numbers a, b, c, where c is the largest number, return *true* if the triangle with sides a, b and c is righ...

3 months ago

Solved

Area of an Isoceles Triangle

An isosceles triangle has equal sides of length x and a base of length y. Find the area, A, of the triangle. <<http://upload...

3 months ago

Solved

Dimensions of a rectangle

The longer side of a rectangle is three times the length of the shorter side. If the length of the diagonal is x, find the width...

3 months ago

Solved

Side of a rhombus

If a rhombus has diagonals of length x and x+1, then what is the length of its side, y? <<http://upload.wikimedia.org/wikipe...

3 months ago

Solved

Side of an equilateral triangle

If an equilateral triangle has area A, then what is the length of each of its sides, x? <<http://upload.wikimedia.org/wikipe...

3 months ago

Solved

Area of an equilateral triangle

Calculate the area of an equilateral triangle of side x. <<http://upload.wikimedia.org/wikipedia/commons/e/e0/Equilateral-tr...

3 months ago

Solved

Length of the hypotenuse

Given short sides of lengths a and b, calculate the length c of the hypotenuse of the right-angled triangle. <<http://upload....

3 months ago

Solved

Length of a short side

Calculate the length of the short side, a, of a right-angled triangle with hypotenuse of length c, and other short side of lengt...

3 months ago

Solved

Vector creation

Create a vector using square brackets going from 1 to the given value x in steps on 1. Hint: use increment.

3 months ago

Solved

Doubling elements in a vector

Given the vector A, return B in which all numbers in A are doubling. So for: A = [ 1 5 8 ] then B = [ 1 1 5 ...

3 months ago

Solved

Flip the vector from right to left

Flip the vector from right to left. Examples x=[1:5], then y=[5 4 3 2 1] x=[1 4 6], then y=[6 4 1]; Request not ...

3 months ago