Answered
using end value in next iteration
Voo = [30 15 13 10]; Vo=Voo while ~all([Va==Vo,Vo==Vn]) (needs to be approx equal to) Vo=Voo Re1 = (D(1).*Vo(1))...

13 years ago | 0

| accepted

Answered
Textscan reading file and surrounding text with single quotes
a={'abcd'} disp(a) disp(a{1}) what is the problem with that?

13 years ago | 1

Answered
Average hourly usgs data
You can do interpolation with interp1 function

13 years ago | 0

| accepted

Answered
I need to loop through each 2-D array in a 3-d matrix and remove all rows in each 2-3 Array that has 0 in column 2.
*Edit* A=randi([0 9],360,5,20); %Example %----------------------------------- [n,m,p]=size(A); B=reshape(A,n,[]); B(any...

13 years ago | 0

Answered
How to mask a figure in Simulink
<http://www.mathworks.com/help/simulink/ug/mask-a-subsystem.html Mask a block>

13 years ago | 0

Answered
How to connect simulink block and simpowersystem block
In SympowerSystem/Electrical Sources choose a controlled Curent Source or Controlled Voltage Source (Depends on what you need). ...

13 years ago | 0

Answered
How to connect simulink block and simpowersystem block
Look at this <http://www.mathworks.com/help/physmod/simscape/ref/simulinkpsconverter.html Simulink-PS Converter>

13 years ago | 0

Answered
How to index filenames correctly?
Use [A,n] = Calc_Exudate(Images(Items(k),:)); % or use a cell array Images={'image001.png';'image003.png';'image020....

13 years ago | 0

| accepted

Answered
reading edit boxes without callback
data{1}=get(handles.editbox1,'string'); data{2}=get(handles.editbox2,'string'); data{3}=get(handles.editbox3,'string'); ...

13 years ago | 0

Answered
Creating new text file
Use square brackets []instead of curly bracket {} Pswmm=[stationID Year Month Day Hour Minute P];

13 years ago | 0

Answered
Day Function not Working
day('2013-05-05 12:33:33','yyyy-mm-dd HH:MM:SS')

13 years ago | 0

| accepted

Answered
How to find major peak values and the avarage distance between them in a signal?
%If y is your signal x=10:0.1:100; y=100*cos(x)./x; plot(x,y) % you have to specify what is the major peak min_peak...

13 years ago | 1

| accepted

Answered
merge multiply cell together
C3=horzcat(C1,C2); C3(cellfun('isempty',C3))=[]

13 years ago | 1

| accepted

Answered
loop for and file nonexistant
folder='Base' for k= 1:80 filename=sprintf('%d.jpg',k) file=fullfile(folder,filename) im{k}imread(file); en...

13 years ago | 0

| accepted

Answered
Importating Data from Excell
% Example a=0:5:995; a=repmat(a,1,5)'; % your array %------------------------------- b=reshape(a,numel(0:5:995),[]); [...

13 years ago | 0

| accepted

Answered
Why does fopen fail to find a file?
You have to specify the folder and the filename, for example folder='E:\matlab' file='yourfilename' finp=fullfile(folder,...

13 years ago | 0

Answered
More efficient way to export output to Excel
*EDIT* header={'A' 'B' 'C' }; priceA=[1 2 3]'; priceB=[4 5 6 8 9 1 0 12 15 20]'; priceC=[7 8 9 10]'; max_n=10; tr=@(pr...

13 years ago | 2

| accepted

Answered
@(x) and inline
f1=@(x) sin(10*x) + cos(3*x) f2=inline('sin(10*x)+cos(3*x)') f1(10) f2(10) inline and @(function_handle) do the same thi...

13 years ago | 0

Answered
Saving a figure without menu?
x=0:0.1:10; y=sin(x) h=plot(x,y) saveas(h,'filename.jpg')

13 years ago | 0

Answered
How can I hold an impulse value for a given time period using Simulink?
Use a <http://www.mathworks.com/help/simulink/slref/zeroorderhold.html zoh> block with sample time set to 5

13 years ago | 0

Answered
plotting all the years of a time period vertically to the x-axis
ns=2838; startDate = datenum('07-01-1996'); endDate = datenum('07-30-2007'); xData = linspace(startDate,endDate,ns); plot...

13 years ago | 1

| accepted

Answered
plotting all the years of a time period vertically to the x-axis
Look at this <http://www.mathworks.com/support/solutions/en/data/1-15TK6/>

13 years ago | 0

Answered
How to reset the static text box each time i press the run button
Where did you put those 3 lines of code? Maybe they are in the static text callback which is wrong

13 years ago | 0

Answered
Replace any string in matrix with NaN
a={'Bad' 'Bad' 'Bad' -6.54; -6.41 -6.32 -6.01 -6.14 ;-6.4 'Bad' 1 2} b=cellfun(@num2str,a,'un',0); a(ismember(b,'Bad'))={na...

13 years ago | 2

| accepted

Answered
How to plot a Matrix?
plot3(G(:,1),G(:,2),G(:,3))

13 years ago | 0

Answered
How to run the same script but for different datafiles consecutively
for k=1:100 file=sprintf('LagrangeMultiplier%d.xlsx',k); LM = xlsread(file,'LM'); CM = xlsread(file,'CM'); ...

13 years ago | 0

Answered
How can I plot an array of data with different color?
x=0:0.01:20; y=sin(x); info=randi([0 1],numel(y),1); y1=y; y2=y; y1(info==0)=nan y2(info==1)=nan plot(x,y1,'r') hold o...

13 years ago | 0

Answered
filling in the blanks in a matrix
*EDIT* t=[0 10 20 30 40 60 70 90 100] v=[30 32 34 36 38 42 44 48 50] ti=0:10:100; vi=interp1(t,v,ti)

13 years ago | 0

| accepted

Answered
Combining two strings to a common string
Variables = {'var1', 'var2', 'var3'}; Sectors = {'sec1', 'sec2'}; [ii,jj]=ndgrid(1:2,1:3); cellfun(@(x,y) [x '_' y],Variabl...

13 years ago | 0

| accepted

Answered
Subtracting 2 matrices of different dimensions
a=[1 3 4 5; 3 3 4 5; 5 5 4 5 2 4 2 6 6 5 2 6 7 2 3 1] [b,idx]=unique(a(:,3:4),'rows','stable') out=...

13 years ago | 1

| accepted

Load more