Answered
Generating Fibonacci Sequence Using While Loop
fibf(1) = 1; fibf(2) = 1; n=3 while fibf(n-1) < 1000 fibf(n) = fibf(n-1)+fibf(n-2); n=n+1; end

12 years ago | 5

| accepted

Answered
stuck again with regular expression
str='SHOT -31045 J CAMERA' out=regexp(str,'\S\s+(CAMERA)','match') out=out{1}(1) %or if there are many cases str='SH...

12 years ago | 1

Answered
How do i introduce an exponential term in the numerator of a transfer function in SIMULINK
You can use two block in series: a transfer function block and a <http://www.mathworks.com/help/simulink/slref/transportdelay.ht...

12 years ago | 2

Answered
Setting up a matrix from input file?
A=[N1 N2 N3]

12 years ago | 1

Answered
how to define a variable as a function of another variable in symbolic toolbox
syms x u u=cos(x) y=u*x out=diff(y,x)

12 years ago | 0

Answered
How to set a specified number of digits when exporting to excel?
a=[101.13123124,99.329040,201.329524,2094.302785] b=arrayfun(@(x) sprintf('%10.4f',x),a,'un',0) xlswrite('file.xlsx',b)

12 years ago | 0

| accepted

Answered
Grouping Figures separately into windows and tabs
Use hold on figure set(0,'DefaultFigureWindowStyle','docked') plot(x,y1) hold on plot(x,y2)

12 years ago | 2

Answered
finding the average of specific rows in each column
a=rand(200,24) [n,m]=size(a); idx=mod(-n,24); a(end+1:end+idx,:)=0; [n,m]=size(a); b=permute(reshape(a',m,24,[]),[2 1 3])...

12 years ago | 1

| accepted

Answered
MATLAB: Too many output arguments
x=1 y=2 z=3

12 years ago | 0

Answered
How do you make multiple variable assignments from s struct?
Why do you need to create all these variables. read this <http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2...

12 years ago | 0

Answered
Index through datestring, selecting whole hours
a={'02-10-2014 20:30' [10934] '02-10-2014 21:00' [10195] '02-10-2014 21:30' [ 9388] '02-10-2014 22:00' ...

12 years ago | 0

| accepted

Answered
logarithmically spaced vector in a certain range
pas=0.1 t=log(3):pas:log(10) out=exp(t) %or n=10 % number of samples out=exp(linspace(log(3),log(10),n))

12 years ago | 2

| accepted

Answered
How to create a block diagonal matrix from the slices of a 3D matrix
k(:,:,1) =[1 2;3 4] k(:,:,2) =[5 6;7 8] k(:,:,3) =[9 10;11 12] q=num2cell(k,[1,2]) blkdiag(q{:})

12 years ago | 3

| accepted

Answered
How to create a block diagonal matrix from the slices of a 3D matrix
k(:,:,1) =[1 2;3 4] k(:,:,2) =[5 6;7 8] k(:,:,3) =[9 10;11 12] out=[]; for ii=1:size(k,3) out=blkdiag(out,k(:,:,ii)) ...

12 years ago | 1

Answered
A way to sample outputs in every 1 us (micro second)
You can use interp1 function

12 years ago | 0

Answered
Create n arrays given a specified n with similar names
no_events=10 for i = 1:no_events; v.(sprintf('event%d',i))=[] end

12 years ago | 0

| accepted

Answered
Where to buy the CAN-AC2-PCI card for the CAN xPC Target environment? Other modules that will work?
There are many (PCI OR PCI Express cards) that work with Simulink real time or with Real Time Windows Target: # Advantch # ...

12 years ago | 1

| accepted

Answered
Setting maximum step size through script
set_param('untitled','maxstep','0.1')

12 years ago | 0

| accepted

Answered
How to create a structure inside a structure?
Example a=struct('rover',struct('assembly',{1 2 3}))

12 years ago | 1

| accepted

Answered
How to use datestr(now)
strrep(datestr(now,'dd.mmmm _ yyyy'),'_','year')

12 years ago | 1

Answered
Simulink to workspace conversion
In the "to workspace" bloc set the sample time to the same value

12 years ago | 0

| accepted

Answered
How to get [1 0 1 0] from '1010'
str2double(regexp('1010','\d','match'))

12 years ago | 1

Answered
how to plot different simulated data in one graph?
use hold on

12 years ago | 0

Answered
Please clarify this statement?
read this <http://www.mathworks.com/help/matlab/matrices-and-arrays.html> you will be able to clarify

12 years ago | 0

Answered
Time steps for random generator in simulink
In model configuration parameter, choose your solver type to fixed step, and just below set your your fundamental sample time. ...

12 years ago | 0

| accepted

Answered
how can I use arrays with different cell types
A={1 [78,9] [10,65] 9 2 3 6 11 7 [9,1] [91,41,96] [10,-1]}

12 years ago | 0

Answered
While loops, please help
there are examples in this <http://www.mathworks.com/help/matlab/ref/while.html help>

12 years ago | 0

Answered
Error using / Matrix dimensions must agree.
You should replace / by ./

12 years ago | 0

Answered
How can I generate a random real numbers from a specific range?
rand*0.2304 For a general case (a,b) a=0.12 b=0.45 out=a+(b-a)*rand;

12 years ago | 0

| accepted

Load more