Answered
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 years ago | 0

| accepted

Answered
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 years ago | 0

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 0

Answered
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 years ago | 1

| accepted

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 0

Answered
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 years ago | 0

Answered
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 years ago | 1

| accepted

Answered
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 years ago | 0

Answered
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 years ago | 0

Answered
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 years ago | 1

Answered
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 years ago | 0

Answered
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 years ago | 0

| accepted

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

12 years ago | 0

| accepted

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 0

Answered
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 years ago | 0

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

12 years ago | 0

Answered
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 years ago | 0

Answered
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 years ago | 1

| accepted

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 0

Answered
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 years ago | 1

| accepted

Answered
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 years ago | 1

| accepted

Load more