Answered
Help "index matrix not consistent"?
domr=[6 7]; domg=[3 4]; domb=[1]; dom=[domr,domg,domb] %or dom=cat(2,domr,domg,domb)

14 years ago | 0

| accepted

Answered
Can't import Excel data
[v,T,vT]=xlsread('Yourfolder/yourfilename')

14 years ago | 0

| accepted

Answered
how to do divide by two concept in simulink.
Pass your signal through a *gain* block with gain value equal to 1/2. Use a divide block when you have to dive varying signal.

14 years ago | 0

Answered
Connect and Run m.files
You can do it with *Matlab function* blocks from *Simulink/User defined function* or *Interpreted Matlab function*

14 years ago | 0

Answered
What should be FFT of a constant function?
If you mean by AC, sinusoidal signal, when you calculate its FFT, it's important to define the interval. To give a sens to your ...

14 years ago | 1

Answered
How to apply cyclic switching in Simulnk?
You control your switches with a *repeating sequences stairs* block

14 years ago | 0

Answered
Error while compiling SIMULINK code for dSpace ControlDesk..
I have not the same card, mine is dSpace 1104, I will try to find out what is your problème, but before, answer these questions:...

14 years ago | 0

| accepted

Answered
how can i give m-file output to simulink model as input
What do you mean by m-file output? If it's a constant variable use TAB's answer, If it's a signal, use from file block, else, ex...

14 years ago | 1

Answered
How to plot strings in an cell array as x axis.
This format is supported by Matlab Example datestr(now,'HH:MM:SS:FFF')

14 years ago | 0

Answered
how to get last column value of a particular variable in matfile
v=[1 2 3] out=v(3) You have to read the basis of Matlab

14 years ago | 0

| accepted

Answered
how to enter data to a simulink model while it is executing
If you don't need to change parameters while your model is running, it's better to stop your model. then use *set_param* functio...

14 years ago | 0

Answered
display values from matfile
v1=rand(1,3); v2=rand(1,3); v3=rand(1,3); v4=rand(1,3); f = figure('Position',[100 100 400 150]); dat = [v1; v2;v3;v4]; ...

14 years ago | 0

| accepted

Answered
how to create global variables for gui created using guide
If you want te handle data in your functions use *guidata*, or just save your data in *Userdata* of any object. help guidata...

14 years ago | 0

Answered
Check elements of matrix
N=1000000; X=rand(1,N)*6; arrayfun(@(x) sum(X(X>x & X<x+1)),1:5)

14 years ago | 0

Answered
How to solve a symbolic system of equations with the solve function?
Let the solver find all the solutions, then just take the positive ones

14 years ago | 0

Answered
solver for digital systems
When I work with digital system, I prefer set solver to discrete with fixed step. Now If you don't set a solver to discrete, an...

14 years ago | 0

| accepted

Answered
plotting in time domain - update plot
g = 9.81; u = 60; t = 0:0.1:12.3; % time in seconds for i = 1:length(t); s(i)= (u.*t(i))-(g.*t(i).^2)./ 2; plot(t...

14 years ago | 0

Answered
Transfer function long format
2.665e-015 is almost equal to zero, because of numerical errors. to eliminate the two first elements n(1:2)=[] model=tf(...

14 years ago | 0

Answered
How to update values ​​in a graph taken from a slider
You need to insert a plot function inside a slider function callback.

14 years ago | 0

Answered
For Loop runs too many times
C=zeros(2,3,4) % preallocate makes your code faster for jj=1:4 A=randi([0 1],2,3); C(:,:,jj)=A end The result is one...

14 years ago | 0

Answered
imwrite() function for save images
Im1=rand(100,100,3) % example of image imwrite(Im1,'yourfolder/Image1.jpg')

14 years ago | 0

Answered
How do I define input and output in state space model?
If you have a MIMO system with 3 inputs and 2 outputs, use Mux block with 3 inputs and Demux block with 2 outputs. <<http://a...

14 years ago | 0

Answered
How to calculate the mean for specific rows in a cell using cellfun
A={rand(4);rand(4);rand(4);rand(4);rand(4);rand(4)} n=numel(A) c=arrayfun(@(x) mean(mean(A{x})),[1 2 n-1 n],'un',0)

14 years ago | 0

Answered
Represent Simulink Integrator block as Matlab Function
I don't know why do you need this, maybe if you explain exactly what you need, there is better way

14 years ago | 2

Answered
simultaneous running of matlab and simulink
The size of your variable simout increase each step, you have just to count the number of step

14 years ago | 0

Answered
logical statement accelerates or decelerates speed?
It's because, when the second for loop wa executed, your computer was more busy. I tried your code, the second for loop was fast...

14 years ago | 0

Answered
CAT arguments dimensions are not consistent. in the cell array.
Maybe you are looking for C={num2cell(rand(1,3)),num2cell(rand(1,6))} x=cell2mat(cellfun(@cell2mat,C,'Un',0))

14 years ago | 0

| accepted

Answered
How can I collapse a vector into a single number?
a = [1 1 0 1 0 1 1 1 0 0] b=num2str(a) idx=strfind(b,' ') b(idx)=[]

14 years ago | 2

| accepted

Answered
A possible bug in solver?
In your above comment, x1 and x2 have the same effect in the equation. In your equations u appears once while x1 appears three t...

14 years ago | 0

Answered
how can i determine whether a matrix of any size is sorted or not (by rows and by columns)?
out1=all(arrayfun(@(x) issorted(A(x,:)),1:size(A,1))) % by rows out2=all(arrayfun(@(x) issorted(A(:,x)),1:size(A,2))) % b...

14 years ago | 0

Load more