Answered
improve performance of this code
out= min(find(any(A))) %or ii= 1; while(1) if any(A(:,ii)) break; else ii= ii+1 end en...

14 years ago | 0

Answered
Radio button panel prblm
set(handles.radiobutton1,'value',0)

14 years ago | 0

Answered
Matlab gui check box problem
set them in your opening function set(handles.yourcheckbox,'value',1)

14 years ago | 0

| accepted

Answered
Matlab function defining problem
When you enter a function f you should enter for example for sine function @sin

14 years ago | 0

| accepted

Answered
corresponding index of an element
Maybe you want this g_counter=[1 0 2 2 0] list=[1 2 3 0 0] idx=intersect(find(g_counter==0),find(list==0))

14 years ago | 0

| accepted

Answered
How to convert a vector length to another length "Compressing or Sampling" ?
Pass your two signals through a *zoh* block with the same sample time as your signal builder

14 years ago | 0

Answered
How to write a Matlab code that shall be executed only once - Embedded MATLAB Function
If you need just to make initialization, you can use * model properties * callbacks * init fcn: then writte in your code

14 years ago | 0

Answered
Put two columns matrix into 1 row matrix
x=[1;2; 3; 4;5] y=[11 ; 22;33;44;55] out=[x y]' out=out(:)'

14 years ago | 0

Answered
How to read text file and put it in to a matrix format.
fid = fopen('file1.txt'); line1 = fgetl(fid); res=line1; while ischar(line1) line1 = fgetl(fid); res =char(res,line1)...

14 years ago | 0

| accepted

Answered
3d plot scale error
use set(gca,'xdir','normal')

14 years ago | 0

Answered
Algebric loop in simulink
use this model <<http://azzimalikcom.ipage.com/ansf412.jpg>>

14 years ago | 0

| accepted

Answered
Why figure toolbar doesn't work in GUI
put this code in your openingFCN function set(gcf,'toolbar','figure');

14 years ago | 2

| accepted

Answered
setting environment paths in matlab
click on * file * set path

14 years ago | 0

| accepted

Answered
Where is my RTW Toolbox?
Real time windows target is not in configuration parameters, it's in Simulink librairy browser, near simulink report generator

14 years ago | 0

| accepted

Answered
How do I create a set of 20 random binary numbers (only 0 and 1) but such that 0 or 1 does not repeat 4 times in a row?
x=zeros(1,20) x(1:10)=1 y=x(randperm(20)) c1=3:4:20 y(c1+1)=not(y(c1))

14 years ago | 0

Answered
Simulink global function call
You can remove nested functions and call them as a independent function from your matlab function

14 years ago | 0

Answered
Find cosine accurate to 6 digits after decimal point
Don't use cos as a variable, because it's a trigonometric matlab function. Also sign is a matlab function "Busy" means your w...

14 years ago | 0

Answered
modify simulink model for running in Real-Time Workshop mode
Use Matlab function, it does'nt work on real-time workshop but support all available functions

14 years ago | 0

Answered
How to change the x ticket lables in a plot?
x=1:12 %the index of months y=x.^2; plot(x,y) set(gca,'xtick',[ 1 3 5 7 9 11]) % use whatever you want

14 years ago | 0

| accepted

Answered
How to use find function to create a sceond array?
Don't use log as a variable, because it's a logarithme function note that log of a negative number is complex log(-6)

14 years ago | 0

| accepted

Answered
How to pass the variables of workspace in GUI
You can use *global* command, but if you tell what do you want exactly, there maby better ways to do it.

14 years ago | 0

Answered
Plotting positive values for given values of r and phi
use *find* command t=0:0.1:10 y=sin(t) idx=find(y>=0) plot(t(idx),y(idx))

14 years ago | 0

| accepted

Answered
Plotting data from multiple runs on the same set of axes?
use *hold on* command plot(t1,y1) hold on plot(t2,y2)

14 years ago | 1

Answered
creating a matrix that contains a struct
A={[0,0,0],[0,0,1];1,1;0,1}

14 years ago | 0

| accepted

Answered
Entering a whole word into an arary.
a={'blue' , 'red', 'green'} a(1) a(2) %or a=struct('color',{'red','blue','green'}) a(1).color a(2).color

14 years ago | 0

Answered
How to enter 2 columns from an array into 1 input?
[ax,h1,h2]=plotyy(h,x,h,y)

14 years ago | 0

Answered
Can these two for loops be avoided?
n=1000; m=10; out=[ reshape(repmat(1:n,m,1),[],1), repmat((1:m)',n,1)] %or out=cell2mat(arrayfun(@(x) [ones(m,1...

14 years ago | 0

| accepted

Answered
problem with cells and lines
a={'1' '2' '3' '4' '5' '6'} a(1:3:6)=[]

14 years ago | 0

| accepted

Answered
forming block in simulink
It's one block: a *sine wave* block, you will find it in *Simulink\Sources*

14 years ago | 0

Answered
I'm getting an error I don't understand: Error using system_ex (line 2)
function dx=system_ex(t,x) dx = zeros(2,1); dx(1,1)=x(2); dx(2,1)=-1.25/3.4*x(1); call your function [t,y]= od...

14 years ago | 1

| accepted

Load more