Answered
Usage of tilde as output
[a,b]=max(sin(1:100)) % a is the maximum value % b is the corresponding index ~ is used to ignore a ( to avoid usin...

14 years ago | 1

Answered
GUI slider value change when majorstep is changed from default?
Try this in this order set(handles.slider1,'Min',0,'Max',1,'Sliderstep',[0.01,0.02]) set(handles.slider1,'value',0) %or...

14 years ago | 0

Answered
using "solve" and getting rid of unknown parameters
You have 2 equations and 3 unknowns variables, which means there are infinite solutions. It's like your are solving E=[x1+2...

14 years ago | 1

Answered
delete the row where is a NaN
% ------Your data------------- n=4 a1=randi(9,n,10); b1=randi(9,n,10); a1( randperm(10*n,10))=nan a=num2cell(a1) b=num...

14 years ago | 0

Answered
Save GUI after pressing pushbutton
You can use a mat file named for example 'initfile', which will be used to default setting in your opening function. Then when t...

14 years ago | 0

Answered
GUI slider value change when majorstep is changed from default?
% In your opening function insert % slider1 is your slider's tag set(handles.slider1,'value',0,'Min',0,'Max',1,'Sliderst...

14 years ago | 0

Answered
Finding the .m file from a data file
Use the same name for your data and m file

14 years ago | 0

Answered
How to implement coupled ordinary differential equations in Matlab
function dz=myeqd(t,y,ti,fi) mu=0.7; r=1; K=1; w=1; F=interp1(ti,fi,t); dz(1)= (mu - r^2)*y(1) - w*y(2) +K*F; dz(2) = (...

14 years ago | 0

| accepted

Answered
how to transfrer data in guide ?
In you opening function insert a code below: set(handles.edit1,'string','YourDefaultValue') Which functions? to read you...

14 years ago | 0

| accepted

Answered
while running simulation of Linear induction motor machine model , i got following error .
Check if there is not division by zero in your model.

14 years ago | 0

Answered
This function does not work and gives the error in P=zeros(n) i don't understand why
What is Psat? Why are using 3 end? function P=BULBP(x,n) P=zeros(1,n); for ii=1:n P(n)=P(n)+x(ii)*Psat(ii); % wha...

14 years ago | 0

Answered
Value of unknown/Parameter Estimation from non-linear equations
Use *fsolve* function

14 years ago | 0

Answered
how to generate a random digital sequence formed of only two bits
randi(2,2,1)'-1

14 years ago | 0

| accepted

Answered
How can I access the value of signals at the time of stopping the simulation.
Don't stop your simulation, just pause it set_param('yourmodel','SimulationCommand','pause') To continue simulation ...

14 years ago | 0

Answered
X = [X1 X2]; - Please Explain
X1=12 X2=24 X = [X1 X2] % create a line vector X by horizontal concatenation; Y=[X1;X2] %vertical concatenation You ...

14 years ago | 0

Answered
converting an array of n symbolic variables to a cell array with n elements
syms x y z a=[x y z] for k=1:numel(a) A{k}=a(k) end

14 years ago | 0

Answered
2D random walk sequence
x1=rand(1,10) x2=rand(1,10) s=100*log(x1) alpha=2*pi*x2 c1=s.*exp(j*alpha) c1_x=cumsum(real(c1)) c1_y=cumsum(imag(c1)) ...

14 years ago | 0

Answered
Using mean function to take average of 4 columns for every row of data
A=rand(5000,14) % Example a=A(:,7:10); out=mean(a,2)

14 years ago | 2

| accepted

Answered
Replacing symbolic vector with changing values
syms x y=[cos(x), cos(x), cos(x), cos(x+5), cos(x+5)] out=arrayfun(@(x) eval(y(x)),1:numel(y))

14 years ago | 1

| accepted

Answered
How can I use local variable from GUI (from subroutine to another subroutine in a main function)
Use guidata. for example to communicate y to other functions y=10 handles.y=y guidata(hObject, handles); %to get y ...

14 years ago | 0

Answered
Assistance Needed - Need to speed up a script for GUI (Main Problem - Extensive use of 'set')
You will need to use a counter, Try also to use guidata

14 years ago | 0

Answered
How do you replicate textread functionality with textscan?
If your cell array is data, then you can get each line you want x=data{:} line20=x(20,:)

14 years ago | 0

| accepted

Answered
Why my code doesn't detect appropriate natural numbers?
1.00000000000000000001==1 the result is 1 The precision has a limit

14 years ago | 0

Answered
How can i edit a .mat file
a=10; v=magic(4) save filename a v To load your file load filename

14 years ago | 0

Answered
Inputting a matrix to a function
Try this clear blockAnalysis blockAnalysis(DATA);

14 years ago | 0

Answered
Best Fit Line Drawing
Use *interp1* function. You can also use a *curve fitting* toolbox % Example x=0:0.5:2 y=x.^2+2*x+rand(1,numel(x)) plo...

14 years ago | 0

Answered
Changing 'double' to 'dataset'
x=1:20 out=dataset(x)

14 years ago | 0

Answered
peaks values of each waveform
use *findpeaks* functin

14 years ago | 1

| accepted

Answered
how to define a random variable in matlab code?
x=rand %or v=rand(3,4) %or randi(10,3,4)

14 years ago | 0

Answered
3D Z number as the same as input value?
x= [1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5] y=[1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5] z =[152 89 10...

14 years ago | 1

| accepted

Load more