답변 있음
How to create interactive custom blocks for simulink?
You can create GUIs for your Gauge/Button/LCD etc and link it with simulink. This is the only option, because simulink doesn't p...

13년 초과 전 | 1

답변 있음
Change the order of the menu bar`s items of the model
You can not change the order of Tool menu items which are predefined. But you can change the order of items added by you. Cus...

13년 초과 전 | 1

문제를 풀었습니다


Replace Vector Elements
Replace all elements in a vector which are equal to or smaller than zero with 0.1. Example: A = [1 2 3 -1 0 2 -3 -80]; ...

13년 초과 전

문제를 풀었습니다


Back to basics 26 - Keywords
Covering some basic topics I haven't seen elsewhere on Cody. Return a cell array of strings of all MATLAB keywords.

13년 초과 전

문제를 풀었습니다


Multiply a column by a row
* Given a column vector C and and a row vector R. * Output a matrix M. * Every column of M equals to C multiplied by correspon...

13년 초과 전

문제를 풀었습니다


Rotate a Matrix
Input a Matrix x, Output y is the matrix rotating x 90 degrees clockwise

13년 초과 전

문제를 풀었습니다


Whether the input is vector?
Given the input x, return 1 if x is vector or else 0.

13년 초과 전

문제를 풀었습니다


Create a cell array out of a struct
Create a cell array out of a (single) struct with the fieldname in the first column and the value in the second column: in: ...

13년 초과 전

문제를 풀었습니다


Convert a vector into a number
This is a sub problem related to this problem: <http://www.mathworks.com/matlabcentral/cody/problems/621-cryptomath-addition>...

13년 초과 전

문제를 풀었습니다


Rotate a Matrix by 90 degrees
Rotate a Matrix by 90 degrees Example: If the input is: X = 1 2 3 4 5 6 7 8 9 ...

13년 초과 전

문제를 풀었습니다


Determine Whether an array is empty
Input a matrix x, output y is TRUE if x is empty, otherwise FALSE.

13년 초과 전

문제를 풀었습니다


Replace May with April
For instance, if the input is input_str = 'The flowers may bloom in April'; then the output is output_str = 'The flo...

13년 초과 전

문제를 풀었습니다


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...

13년 초과 전

문제를 풀었습니다


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...

13년 초과 전

문제를 풀었습니다


Sum of diagonal of a square matrix
If x = [1 2 4; 3 4 5; 5 6 7] then y should be the sum of the diagonals of the matrix y = 1 + 4 + 7 = 12

13년 초과 전

답변 있음
How to add a C header file to the C-Mex S-function?
Better you use the *<http://www.mathworks.in/help/toolbox/simulink/sfg/bq4g1es-1.html Legacy code tool>* or *<http://www.mathwor...

13년 초과 전 | 1

| 수락됨

답변 있음
Is it possible to configure controller SFR in Simulink as a part of Autocode generation?
The best option is, write your low level code (interrupt, peripheral configuration etc) manually and integrate the autogenerate...

13년 초과 전 | 0

| 수락됨

답변 있음
Simulink: Setting Mask's tab visibility
AFAIK, you can not completely disable a tab. But, using below piece of code, you can *turn-off* the visibility of all parameters...

13년 초과 전 | 0

| 수락됨

문제를 풀었습니다


Finding Perfect Squares
Given a vector of numbers, return true if one of the numbers is a square of one of the other numbers. Otherwise return false. E...

13년 초과 전

문제를 풀었습니다


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]

13년 초과 전

문제를 풀었습니다


Binary numbers
Given a positive, scalar integer n, create a (2^n)-by-n double-precision matrix containing the binary numbers from 0 through 2^n...

13년 초과 전

문제를 풀었습니다


Return the 3n+1 sequence for n
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

13년 초과 전

답변 있음
import value from text file
fid = fopen('YourFile.txt'); data = textscan(fid,'%s','delimiter','\n'); cellfun(@eval,data{1}); fclose(fid);

13년 초과 전 | 0

답변 있음
How to view mdl files
Simulink opens the .mdl file in graphical ways. So you can not read ASCII information of .mdl file simulink window. But you c...

13년 초과 전 | 3

| 수락됨

답변 있음
Bus Type without any elements
A bus must have atleast *one* element. So a bus object (or bus type) must have atleast *one* element. What will you do of a ...

13년 초과 전 | 2

답변 있음
coder.EmbeddedCodeConfig: CustomSourceCode: How to specify multiple lines of code.
cfg.CustomSourceCode = sprintf('%s\n\r%s',... '#include "file1.h"','#include "file2.h"');

13년 초과 전 | 0

| 수락됨

답변 있음
how do i give xxx.txt file as input to Embedded Matlab Function in simulink model
Simulink can not use text file as input. You can use matlab functions like *fopen*, *fread*, *fclose* in simulink inside *Mat...

13년 초과 전 | 0

답변 있음
How can I create a variable length string in MATLAB ?
% Create String MyStr = 'abcd'; % Change later MyStr = 'lmnopqrst';

13년 초과 전 | 0

| 수락됨

답변 있음
Variant subystems with mixed discrete/continuous?
See <http://www.mathworks.in/help/toolbox/simulink/ug/bsn4_q2-1.html Code Generation of Variants>. I think enabling *Override...

13년 초과 전 | 1

답변 있음
How to put a picture on a button in a GUI?
See <http://www.mathworks.com/matlabcentral/fileexchange/12033-placing-image-on-a-button simple example1>. <http://www.ma...

13년 초과 전 | 6

| 수락됨

더 보기