Answered
I want to assign values from a 1d array to 2d array. How should I do it?
x is not defined in your code

13 years ago | 0

Answered
How to go back to check condition again after the if-else statement
test=0; while test==0 cond=exp(z(2)*(1-z(1)))-(1/z(3)); if cond<0 h=@test; znew=simulannealbnd(h,z,[0 0 0],[1.0 1...

13 years ago | 0

| accepted

Answered
How to create modules?
Your Matlab file can call other matlab files just by typing their names. You can also create <http://www.mathworks.com/help/matl...

13 years ago | 0

| accepted

Answered
Conditionally assign values to cells based on values of preceding cells.
Example v={'a1' 'b1' 'c1';1 2 3;4 5 6;'a2' 'b2' 'c2';8 9 2;3 5 1;'a3' 'b3' 'c3';0 1 2 ;0 0 1} c1=v(:,1); idx1=find(~cellf...

13 years ago | 0

Answered
maximizing efficiency in simple commands
x=[1 2 3 4]; M=repmat(x,4,1)

13 years ago | 0

| accepted

Answered
How to solve a trasfer function absolute value whit the tf function command.
Example N=1; D=[1 10] model=tf(N,D) % your transfer function Now what do you mean by: An absolute value of a transfer...

13 years ago | 0

Answered
How Simulink block works? How to program it?
Both your blocks work on real time simulation

13 years ago | 0

Answered
Error in the code :Input must be cell arrays of strings
When you use inputdlg the result is a cell, then use x=str2double(inputdlg(prompt{1},name)); y=str2double(inputdlg(prompt{...

13 years ago | 0

| accepted

Answered
Delete Rows With empty elements
data1(any(cellfun(@(x) any(isnan(x)),data1),2),:)=[]

13 years ago | 1

| accepted

Answered
help with plotting 3 data series
x=data(:,1); y=data(:,2:4); plot(x,y) a=sort(y'); b=repmat(x',3,1) hold on plot(b,a)

13 years ago | 0

| accepted

Answered
How do you subtract/add with roll under/over
*Edit* a=uint8(-1); out=uint8(255)*uint8(not(a))+a

13 years ago | 0

Answered
Matlab function help in simulink model
function y = func_name(a) persistent b if isempty(b) b=0; end b=b+a; y=b; Look at <http://www.mathworks.com/hel...

13 years ago | 0

| accepted

Answered
How can I generate an array that satisfies a given number of repetitions and unique values
*Edit* x = [3 2 1 2] y = [1 2 3 4] z=arrayfun(@(ii,jj) repmat(jj,1,ii),x,y,'un',0)

13 years ago | 0

| accepted

Answered
How to generate N number of loops
%or more general I = {'AUU','AUC','AUA'}; H = {'CAU','CAC'}; Q = {'CAA','CAG'}; L={'s1','s2','s3'}; v={I,H,Q,L} v0=v{1...

13 years ago | 1

Answered
sortrows based on previous sort results
B=sortrows(B,[1 4 9 10]) B=sortrows(B,[1 4 9 10 16])

13 years ago | 0

Answered
Cell contents assignment to a non-cell array object.
Maybe your cell array |handles.myList| was used as double before these lines of code

13 years ago | 0

Answered
changing Ticklabel in colorbar
set(gca,'xtick',[0 5 10])

13 years ago | 0

Answered
Data binning and frequency of data
*Edit* X= [56 65 59 98 97 35 54 42]; id=50:5:70 result=histc(X,id) range=[id(1:end-1)' id(2:end)']; out=[range result(1...

13 years ago | 0

| accepted

Answered
How to take value of particular interval from a column?
a(a(:,1)>800 & a(:,1)<1000,1)=nan

13 years ago | 0

| accepted

Answered
displaying contents in a list bx after button press
Your code is not clear for me, but I see that you are creating a list in the listbox callback while you should do it in the push...

13 years ago | 0

| accepted

Answered
Run two subsystem in parallel in simulink
Like you run any other models.

13 years ago | 1

Answered
Appending vectors in a loop
out=Data2(ismember(cell2mat(Data2(:,1)),Data1),:) % to change values of Data1 from -1 to 0 Data1(Data1==-1)=0

13 years ago | 0

| accepted

Answered
Compute,store, and find min of 3d distances between two different matrices.
A=randi(100,2,2,3) B=randi(100,2,2,3) D=sqrt(sum((A-B).^2,3))

13 years ago | 0

Answered
how to use strcmp within the same column
s={'a';'a';'a';'b';'b';'c';'c';'c'} Give an example, what do you want ? maybe b='a' out=s(strcmp(s,b))

13 years ago | 0

Answered
time make my program unstable
I don't think that your system becomes unstable for no reasons. set your stop time to a value before your system becomes unstabl...

13 years ago | 0

Answered
Need help with datestr
yourdate='16-Aug-2013 15:54:31' datestr(yourdate,'HH:MM:SS')

13 years ago | 1

| accepted

Answered
How do I find the last occurrence of a match using regexp in MATLAB?
str = '/* This is a comment */ int x; /* sectionEndExample */'; pattern='(/)\*[\w\s]+\*(/)'; [sectionEndIdx1,debut,fin] = re...

13 years ago | 1

| accepted

Answered
how to scale the array type double of range [-1,1] to [0,1] and [0,360] to[0,1]
a=-1:0.1:1 b=a-min(a) e=max(a)-min(a) out=b/e % you can use the same code for all cases

13 years ago | 0

Answered
In an assignment A(I) = B, the number of elements in B and I must be the same.
rho = 1.21; c = 343; c2 = c^2; V = 1+0*1i; Qb = 1/(sqrt(2)); Vas = 0.008778; Sd = 0.0062; Sd2 = Sd^2; Qm = 1.4; Qe = 0....

13 years ago | 0

| accepted

Answered
Time messed up after import from xls
d=[0 1.15740740740741e-05 2.31481481481481e-05 3.47222222222222e-05 4.62962962962963e-05 5.78703703703704e-05] datestr(d...

13 years ago | 0

| accepted

Load more