해결됨

Number of 1s in a binary string

Find the number of 1s in the given binary string. Example. If the input string is '1100101', the output is 4. If the input stri...

4달 전

해결됨

Return the first and last character of a string

Return the first and last character of a string, concatenated together. If there is only one character in the string, the functi...

4달 전

해결됨

Getting the indices from a vector

This is a basic MATLAB operation. It is for instructional purposes. --- You may already know how to <http://www.mathworks....

4달 전

해결됨

Check if number exists in vector

Return 1 if number _a_ exists in vector _b_ otherwise return 0. a = 3; b = [1,2,4]; Returns 0. a = 3; b = [1,...

4달 전

해결됨

Swap the input arguments

Write a two-input, two-output function that swaps its two input arguments. For example: [q,r] = swap(5,10) returns q = ...

4달 전

해결됨

Reverse the vector

Reverse the vector elements. Example: Input x = [1,2,3,4,5,6,7,8,9] Output y = [9,8,7,6,5,4,3,2,1]

4달 전

해결됨

Length of the hypotenuse

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

4달 전

해결됨

Generate a vector like 1,2,2,3,3,3,4,4,4,4

Generate a vector like 1,2,2,3,3,3,4,4,4,4 So if n = 3, then return [1 2 2 3 3 3] And if n = 5, then return [1 2 2...

4달 전

해결됨

Maximum value in a matrix

Find the maximum value in the given matrix. For example, if A = [1 2 3; 4 7 8; 0 9 1]; then the answer is 9.

4달 전

해결됨

Better Index Number

Let's say you want to save many, many files and append these files with a certain sortable index number. As you probably know, y...

4달 전

해결됨

Pattern Sum

Write a function which receives two single digit positive integers, (k and m) as parameters and calculates the total sum as: k...

4달 전

답변 있음

i need to convert data from hourly data to daily data and plot these data

Import using a timetable. https://www.mathworks.com/help/matlab/timetables.html Decide how you want to decimate the data in col...

i need to convert data from hourly data to daily data and plot these data

Import using a timetable. https://www.mathworks.com/help/matlab/timetables.html Decide how you want to decimate the data in col...

4달 전 | 0

답변 있음

Passing parameters to dde23 slows it down

Anonymous functions carry some overhead. I wonder if the way it's parsing the arguments to dde23 is causing it to rebuild the an...

Passing parameters to dde23 slows it down

Anonymous functions carry some overhead. I wonder if the way it's parsing the arguments to dde23 is causing it to rebuild the an...

4달 전 | 0

답변 있음

Concatenate fields of a structure into a matrix

Long-term, it sounds like you might want to consider a different data structure, if that's an option. In the interim, try cell2...

Concatenate fields of a structure into a matrix

Long-term, it sounds like you might want to consider a different data structure, if that's an option. In the interim, try cell2...

4달 전 | 0

답변 있음

Error in Integrator is not finite. How can I fix it?

Since this happens at t=0, are you possibly dividing the block's input along the way by something that could be zero on simulati...

Error in Integrator is not finite. How can I fix it?

Since this happens at t=0, are you possibly dividing the block's input along the way by something that could be zero on simulati...

4달 전 | 0

답변 있음

Viewing figure is not possible.

matplotlib takes an explicit "show" command. Try: py.matplotlib.pyplot.show()

Viewing figure is not possible.

matplotlib takes an explicit "show" command. Try: py.matplotlib.pyplot.show()

4달 전 | 0

답변 있음

Messagebox warning in matlab

The NCC return value you're getting back is a matrix of correlation values (for Lena, it's 512x512). The string you're passing t...

Messagebox warning in matlab

The NCC return value you're getting back is a matrix of correlation values (for Lena, it's 512x512). The string you're passing t...

4달 전 | 0

| 수락됨

답변 있음

Printing outputs when running C code in simulink via the coder.ceval function

Not completely sure about this one, but if there is there a way to access the Simulink diagnostics panel from within the C code,...

Printing outputs when running C code in simulink via the coder.ceval function

Not completely sure about this one, but if there is there a way to access the Simulink diagnostics panel from within the C code,...

4달 전 | 1

답변 있음

save animation ,i need help

Sofiane, Take a look at the VideoWriter and getFrame functions: https://www.mathworks.com/help/matlab/ref/videowriter.html Sp...

save animation ,i need help

Sofiane, Take a look at the VideoWriter and getFrame functions: https://www.mathworks.com/help/matlab/ref/videowriter.html Sp...

4달 전 | 0

답변 있음

I got this error while running a simulink model

You generally get this error when your simulation has an error that causes one of the states to grow exponentially until one of ...

I got this error while running a simulink model

You generally get this error when your simulation has an error that causes one of the states to grow exponentially until one of ...

4달 전 | 0

답변 있음

Loading and saving variables when using parallel toolbox

File access with parallel workers can be tricky, and in the past I've been successful by creating a separate temp directory per ...

Loading and saving variables when using parallel toolbox

File access with parallel workers can be tricky, and in the past I've been successful by creating a separate temp directory per ...

5달 전 | 1

| 수락됨

답변 있음

How do I highlight very faint lines from an image?

Have you tried the Hough transform? https://www.mathworks.com/help/images/ref/houghlines.html

How do I highlight very faint lines from an image?

Have you tried the Hough transform? https://www.mathworks.com/help/images/ref/houghlines.html

5달 전 | 0

답변 있음

Plot variables with similar names.

Are they already saved variables? If not, can you assign using a cell format instead? The mapping would look something like: v...

Plot variables with similar names.

Are they already saved variables? If not, can you assign using a cell format instead? The mapping would look something like: v...

5달 전 | 0

답변 있음

Associate Map container with specific values

Map containers are a type of hash object, but not all MATLAB datatypes are hashable. The keys of containers are limited to a sub...

Associate Map container with specific values

Map containers are a type of hash object, but not all MATLAB datatypes are hashable. The keys of containers are limited to a sub...

5달 전 | 0

답변 있음

How can I plot in dB in Matlab?

Decibels are a ratiometric measurement. For power, as shown in your plot, the reference is 1 milliwatt (denoted from the dBm). 0...

How can I plot in dB in Matlab?

Decibels are a ratiometric measurement. For power, as shown in your plot, the reference is 1 milliwatt (denoted from the dBm). 0...

5달 전 | 0

답변 있음

Does this variable exist

For structures, use isfield() clear a a.M = 'hat'; isfield(a,'M') % True isfield(a,'N') % False For array size, use length(...

Does this variable exist

For structures, use isfield() clear a a.M = 'hat'; isfield(a,'M') % True isfield(a,'N') % False For array size, use length(...

5달 전 | 0

답변 있음

Making the if statement in a for loop display only one iteration of the message

Looks like it takes 25 iterations to converge. Are you looking for it to display at the very end a Success/Failure message? The...

Making the if statement in a for loop display only one iteration of the message

Looks like it takes 25 iterations to converge. Are you looking for it to display at the very end a Success/Failure message? The...

5달 전 | 0

답변 있음

NEED HELP SOLVING "Array indices must be positive integers or logical values"

Does it need to be a one-liner? If you can grab the x,y coordinate, you could clamp your index points to the box bounds using %...

NEED HELP SOLVING "Array indices must be positive integers or logical values"

Does it need to be a one-liner? If you can grab the x,y coordinate, you could clamp your index points to the box bounds using %...

5달 전 | 0

답변 있음

Change Simulink parameters in Matlab function

Simulink will look for variables in MATLAB's base workspace by default. Since var1 and var2 are defined in the function's worksp...

Change Simulink parameters in Matlab function

Simulink will look for variables in MATLAB's base workspace by default. Since var1 and var2 are defined in the function's worksp...

5달 전 | 0