답변 있음
Bit stream in to digits
Raza, you can retrieve the bit pattern by concatenating the cell strings: [r, c] = size(b); bit_stream = []; for ii =...

대략 12년 전 | 0

| 수락됨

답변 있음
Input argument "s" is undefined ,what does this mean?
Neel, did you call the function with proper input arguments, such as >> rec = interpolation([1;2],3,1) % I am just making ...

대략 12년 전 | 0

답변 있음
How to 'extract" a matrix named the same way as a string in a matrix?
Aroldo, is this what you are looking for? E0 = [1 2]; L = {'R1' 'E0'}; v = genvarname(L{2}); % change from L{2} to ...

대략 12년 전 | 0

| 수락됨

답변 있음
auto format x axis
Jason, this should do: t = 0:4700; y = rand(1,length(t)); % your data t_lim = 1e3*ceil(t(end)/1e...

대략 12년 전 | 0

| 수락됨

답변 있음
What is the reason for color of lines are repeating?
Venkatesan, could be that there is a hold on command, somewhere in the code? If so, replace by hold all to get d...

대략 12년 전 | 0

답변 있음
How to integrate 6 different variables into a struct?
Metin, you could simply use a cell array. As an example: New_form = {A D; B E; C F}; In this case |D| is accessed as ...

대략 12년 전 | 1

| 수락됨

답변 있음
Inserting a circle at specific coordinates
Rasmus, for the general case (circle with noise) check out <http://www.mathworks.com/matlabcentral/fileexchange/5557-circle-fit ...

대략 12년 전 | 0

| 수락됨

답변 있음
append one graph to another
You mean something along the lines of: x1 = 1:50; x2 = 1:10; x3 = 1:10; y1 = rand(1,50); y2 = rand(1,10); y3...

대략 12년 전 | 0

답변 있음
Writing Code For a Function
Shreef, replace prog::wait(3.0) % unless you are using MuPAD (symbolic) by pause(3) What are you trying to do ...

대략 12년 전 | 0

답변 있음
Is my bode plot inaccurate?
Quid, the Bode plot is correct. To compute the magnitude of the |P| you need to replace (substitute) the complex frequency |s| b...

대략 12년 전 | 1

| 수락됨

답변 있음
plot different colors in one trace concerning to the values
Hello Tim, would this do? x = linspace(1,2000,2000); y = sin(x/100); xx = {x(x<501) x(x>=501 & x<550) x(x>=550)}; ...

대략 12년 전 | 0

답변 있음
3*3 matrix in loop - calculation give NaN, why ?
This can happen for a range of reasons. In your case I would suspect that some of the values in |relor| are zero. Dividing zero ...

대략 12년 전 | 0

답변 있음
covert matlab program to simulink block
Shiksha, yes, provided I correctly understand your question. You can include MATLAB functions in Simulink models (e.g., by us...

대략 12년 전 | 1

답변 있음
Can I get outputs numbered each time it goes through a loop?
Ry, you could add disp(['Loop iteration: ', num2str(k)]); just before the |end| of the loop. It displays some text and th...

대략 12년 전 | 0

답변 있음
User definition of cell contents
Tom, you could use a <http://www.mathworks.com/help/matlab/matlab_prog/create-a-structure-array.html structure array>. As an exa...

대략 12년 전 | 0

| 수락됨

답변 있음
making blocks using for loop
Raza, this should do the trick: s = '101010001110100101010010010001010' s0 = '000000000'; b = {}; for ii = 1:...

대략 12년 전 | 0

| 수락됨

답변 있음
Help definitely needed! How do I load multiple txt files and change the varible names of each to include the date from file
Masao, assuming that the only the year changes in each filename, use for ii = 1973:2013 f_name = strcat('midas_wind_',...

대략 12년 전 | 0

| 수락됨

답변 있음
pass matlab variables to text file
Gerrit, I believe you already got most of what you need: my_var = 3; fid = fopen('test.htm','a'); fprintf(fid, ['<H2>...

대략 12년 전 | 0

| 수락됨

답변 있음
Error using textscan Invalid file identifier. Use fopen to generate a valid file identifier
Laura, use fnm = 'D02e1.txt'; fid = fopen(fnm,'r'); The filename needs to be a string of characters.

대략 12년 전 | 0

답변 있음
Finding which curve is which.
Roshan, use a |legend|, which gives you the information right in the plot. As an example: x = 0:0.1:pi; lab = []; hold...

대략 12년 전 | 0

답변 있음
PROBLEM WITH SAVING EXCEL FILE ?
Shanky, use <http://www.mathworks.com/help/matlab/ref/strcat.html |strcat|> instead filename = strcat(num2str(sNumber),'_Exc...

대략 12년 전 | 0

답변 있음
Undefined function (missing) 'tile'
Bobby, in this case |tile| is a variable that needs to be initialized before it can be used. The input parameter for the |gunzip...

대략 12년 전 | 0

답변 있음
Subscript indices must either be real positive integers or logicals.while using indexing
Use |clear all| and then copy-paste-execute a = [2 5 9]; b = [0 0 0 0 0 0 0 0 0 0]; b(a) = 1 Does that do the trick?

대략 12년 전 | 1

| 수락됨

답변 있음
To plot the model error against time
Priya, the "correct" syntax for subplots is: subplot(2,1,1) % notice the commas Other than that, what is size(delta...

대략 12년 전 | 0

| 수락됨

답변 있음
How to assign value in an array depending on the index stated in another array
Use b(a) = 1

대략 12년 전 | 1

| 수락됨

답변 있음
How can I plot lines with varying opacities/colors at each point?
Will, check out this <http://www.mathworks.de/matlabcentral/answers/5042-how-do-i-vary-color-along-a-2d-line#answer_7057 answer>...

대략 12년 전 | 0

| 수락됨

답변 있음
Removing characters from/breaking up file names
B.M. you could use the <http://www.mathworks.com/help/matlab/ref/strfind.html |strfind|> command: str = '02-Feb-2009_1.xls';...

대략 12년 전 | 0

| 수락됨

답변 있음
Matrix Calculation in MATLAB
Tanya, use symbolic math: syms x A = (2-x)*(3-x) A = (x - 2)*(x - 3) or, to solve your problem A = (2-x)*(3-x) -...

대략 12년 전 | 0

답변 있음
Slope of a line
In general, your equation is correct, |k = dY/dX|, however, in X = (max([50 50])-min([50 50])); % 50 - 50 = 0 Y =...

대략 12년 전 | 1

| 수락됨

답변 있음
Block and un-block items
Each object in a GUI has a unique name which you can use to set parameters for. As an example, for a pushbutton you would use: ...

대략 12년 전 | 1

| 수락됨

더 보기