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

mehr als 12 Jahre vor | 0

| akzeptiert

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 0

| akzeptiert

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

mehr als 12 Jahre vor | 0

| akzeptiert

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 1

| akzeptiert

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

mehr als 12 Jahre vor | 0

| akzeptiert

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 1

| akzeptiert

Beantwortet
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)}; ...

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 1

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 0

| akzeptiert

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

mehr als 12 Jahre vor | 0

| akzeptiert

Beantwortet
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_',...

mehr als 12 Jahre vor | 0

| akzeptiert

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

mehr als 12 Jahre vor | 0

| akzeptiert

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 0

Beantwortet
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?

mehr als 12 Jahre vor | 1

| akzeptiert

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

mehr als 12 Jahre vor | 0

| akzeptiert

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

mehr als 12 Jahre vor | 1

| akzeptiert

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

mehr als 12 Jahre vor | 0

| akzeptiert

Beantwortet
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';...

mehr als 12 Jahre vor | 0

| akzeptiert

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 1

| akzeptiert

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

mehr als 12 Jahre vor | 1

| akzeptiert

Mehr laden