Answered
finding an output from a matrix using a single syntax
There is a way to select the element using logical index. It is like this: Ind=false(size(Q)); Ind(3,1)=true; Ind(2,2)=tr...

15 years ago | 0

Answered
Import txt file and pick the values after the selected key words using Regular Expression
For a file like this, I prefer using fgetl(). %% NumbCount=0; TypeCount=0; fid=fopen('test.txt'); fline=fgetl(fid); ...

15 years ago | 1

Answered
issue with audioplayer/sound functions
Do you have return argument for your collectData function? If not, you could add one, for example CompleteFlag=collectData(). Th...

15 years ago | 0

| accepted

Answered
PLEASE HELP ME.... TO INSTALLATION PROBLEM
Go to Computer->System properties->Advanced system settings->Environment Variables, check the variable "TEMP" and "TMP" to see i...

15 years ago | 0

| accepted

Answered
Plotting histogram question ?
%% a=rand(100,1); a(a>=0.7)=1; a(a<=0.2)=2; a(a<0.7 & a>0.2)=3; figure(1);n=hist(a(:),0:5); percent=n/su...

15 years ago | 1

| accepted

Answered
Finding total count of values in a cell array?
cnt=cellfun('isempty',A); cnt=sum(cnt(:));

15 years ago | 1

| accepted

Answered
about simulink block
See <http://blogs.mathworks.com/seth/>. On the right below Links, you'll find "Getting Started" and "Tutorial"

15 years ago | 0

Answered
control system toolbox - state space model containing constant vectors
That means your input has an offset. For example Define New_u=u+Offset, so u=New_u-Offset and put it in your equation. dx/...

15 years ago | 0

Answered
How to extract info from a chemical formula
Use the combination of isstrprop() and regexp() might help. You need to provide more examples and explain what you want. %% ...

15 years ago | 2

Answered
Simulink disabling drag-and-drop while running
I assume you have a simulation that takes long time to run and you don't want to mess up with the blocks while it is running. ...

15 years ago | 2

| accepted

Answered
Display plot/image on fraction of figure area
%% fig=figure; h_axes=axes('parent',fig,'position',[.1 .1 .8 .7]); plot(h_axes,1:10); h_text=uicontrol('style','te...

15 years ago | 2

Answered
play video
implay()

15 years ago | 0

Answered
Logical Indexing returns error
It is not the number of rows. Your code won't work for nx2 array. You need to do this: initial_data=rand(10,2); extracted_d...

15 years ago | 1

| accepted

Answered
Opening and Saving files
csvwrite() or dlmwrite() BTW, you could easily get rid of the double quote symbol. A='"3", "2008/01/02", "c31213"'; B=strr...

15 years ago | 0

Answered
How to access input variable in base workspace?
You have to start with the base workspace. For example, you have par=1 in base workspace. Then you call your function Process(pa...

15 years ago | 0

| accepted

Answered
Playing wav/midi
Does this give you an idea? system('C:\WINDOWS\system32\dllcache\wmplayer http://www.satelitemusical.net/mj-akon-hold-my-hand...

15 years ago | 0

Answered
Read Files from Directory
The function is dir(). Files=dir('*.*'); for k=1:length(Files) FileNames=Files(k).name end

15 years ago | 13

| accepted

Answered
Importing Excel Data with Custom Data Format [hh]:mm:ss.00
use [Num, Txt, Raw]=xlsread() to read the data. Use the data in Raw which is suppose to be the raw format. Then use the MATLAB f...

15 years ago | 0

Answered
Append Data to Excel File
If the Excel file is not abnormally huge, I would read it in with xlswrite(), append the data to the end of the first column, an...

15 years ago | 0

Answered
Fill matrix with random letters and numbers
A9=['A':'Z' '0':'9';]; Data=zeros(length(A9),20); for k=1:size(Data,2) Data(:,k)=randperm(length(A9)); end Data=...

15 years ago | 2

| accepted

Answered
Calculate the power using the current values inside matrix
Voltage=1:6; Current=0.1:0.1:0.6; Power=zeros(6,6); for k=1:6 for j=1:6 Power(k,j)=Voltage(k)*Current(j)...

15 years ago | 0

Answered
is there something similar to Excel Solver in Matlab?
From help robustfit. x = (1:10)'; y = 10 - 2*x + randn(10,1); y(10) = 0; bls = regress(y,[ones(10,1) x...

15 years ago | 0

Answered
How to extract numerical Datafrom txt-File with mixed string and numerical Data
%% fid=fopen('test.txt','rt'); k=0; fline=fgetl(fid); while ~feof(fid) if strfind(fline,'GOTO/') ...

15 years ago | 0

| accepted

Answered
Delete Rows that have a negative number in their first column.
A=[-1 2;2 -4;-5 9;-3 7;8 6;] Index=A(:,1)<0; NewA=A(~Index,:) Or, a one-liner: A=[-1 2;2 -4;-5 9;-3 7;8 6;] A(A(:,1)...

15 years ago | 2

Answered
How to output all X values of bifurcation diagram for logistic map?
x is over-written in every loop. If you want to keep a history and observe it, you can save it to a different array, X for examp...

15 years ago | 3

| accepted

Answered
I want Absolute numerical integral-sth like absolute trapz
Your y HAS negative values. plot(x,y) to take a look. This is a simple task. There is a theoretical solution of the integrati...

15 years ago | 0

Answered
simulataneous Curve fitting
Subtract your first curve with 1a, second curve with 2a and third curve with 3a and then do the curve fitting?

15 years ago | 0

Answered
read an empty line in a file
use while ~feof(fid) instead

15 years ago | 0

Answered
compare particular strings in filenames array
So you want to compare the file names with some strings to see if they partially match. Use dir() to get all your file names fro...

15 years ago | 1

Answered
Breakpoints required for code to work correctly?
What do you mean "doesn't seem to work"? Any error messages? If you don't have break point, is it that the progress bar didn't c...

15 years ago | 1

| accepted

Load more