Answered
if statement - working with characters
Use if isequal(f{1} ,'january')

13 years ago | 7

| accepted

Answered
Tricky correction of faulty time list
v={'12:00';'12:05';'13:45';'09:15';'08:25';'08:32';'15:20';'15:26'} c=cellfun(@(x) str2double(regexp(x,'(?<=\:).+','match')),...

13 years ago | 0

| accepted

Answered
Using Indexing from values in another vector
i = [1 1 2 3 3]'; n = [2 1 2]'; j = [1 3 2 2 3]; idx2= cumsum(n); idx1=[1; idx2(1:end-1)+1]; for k=1:numel(idx1) s...

13 years ago | 0

| accepted

Answered
how can i read image with matlab
Use imread function help imread

13 years ago | 0

| accepted

Answered
Convert Value from form to another
sprintf('%.7f',9.0295e-005)

13 years ago | 0

| accepted

Answered
How can I arrange given matrix in other matrix form?
M=[A(:),C(:),D(:)]

13 years ago | 0

Answered
Problem with GUI plotting
add hold(handles.axes1, 'on')

13 years ago | 0

| accepted

Answered
How to dynamically name variables based on a list and assign arrays from a cell array
<http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F>

13 years ago | 0

Answered
Can imnoise return the indices of locations where noise was added?
If Im1 is the original image and Im2 the disturbed one, you can find the indices by [ii,jj]=find(Im1~=Im2) %OR [ii,...

13 years ago | 0

Answered
How can I stop uicontrol from changing my scalar input to a vector?
a=get(hx,'String') % is char b= str2double(a) % convert to double isscalar(b)

13 years ago | 0

| accepted

Answered
Store values from GUI to a cell array in workspace
I am not sure to understand your question, if you want to pass data in your callback function, use guidata, or save your data i...

13 years ago | 0

| accepted

Answered
i want to draw sine graph using for loop in matlab
Use a <http://fr.wikipedia.org/wiki/S%C3%A9rie_de_Taylor Taylor Series>

13 years ago | 0

Answered
Matrix Elements Manipulation Using Matlab
a=zeros(4,7); a(:,1:2:end)=A; a(:,2:2:end)=B; b=zeros(3,7); b(:,1:2:end)=C; b(:,2:2:end)=D; out=zeros(7); out(1:2:end,:...

13 years ago | 2

| accepted

Answered
deleting rows and columns of a matrix
b=a a(:,1)=[]; %If you want your original a a=b

13 years ago | 1

| accepted

Answered
How can i read coeffictents stored in workspace from excel into matlab?
use xlsread function

13 years ago | 0

Answered
how can i plot a character like A, B ,C in a 7*7matrix
Use a cell array v={'A' 'B' 1;'C' 'D' 2}

13 years ago | 0

Answered
How to create a meshgrid padded with a triangle of zeros in the upper-right and lower-left corners
a=1:7 m=4; b=repmat([a zeros(1,m)]',1,m); out=reshape(b(1:end-m),[],m)

13 years ago | 0

Answered
How to create a meshgrid padded with a triangle of zeros in the upper-right and lower-left corners
a=1:7 n=numel(a); m=4; b=[a';zeros(m-1,1)]; out=cell2mat(arrayfun(@(x) circshift(b,[x 0]),0:m-1,'un',0))

13 years ago | 0

Answered
how to expand a matrix size
You can use interp1 %%example n=1:258 data=sin(0.1*n) figure; plot(n,data); ni=linspace(1,258,6204); datai=interp1(...

13 years ago | 0

Answered
Delete rows for specific elements from a matrix
f = [2 5 4 3 2; 4 9 2 1 9; 2 0 0 0 0; 4 0 0 0 3; 9 7 12 14 42]; f(all(~f(:,2:3),2),:)=[] %or f=f(any(f(:,2:3),2),:)

13 years ago | 0

| accepted

Answered
how to reorder matrix data?
Example a=[1 11 2 22 3 33;4 44 5 55 6 66;7 77 8 88 9 99] out=reshape(a',2,[])'

13 years ago | 0

| accepted

Answered
problem in the code,getting following error
clear img_hist for i=1:256 img_hist{i}=sum(sum(im==(i))); end

13 years ago | 0

Answered
How can I comment out Simulink subsystem from Matlab script?
Suppose your model name is |untitled| , and you want to comment out the block named |Unit Delay| set_param('untitled/Unit D...

13 years ago | 4

| accepted

Answered
Find elements of an array in another array
I prefer this one. It should be much faster A=[1 2 3 4 5 6 7] B=[12 13 2 4 3 2 4 2 25 1 6 7 5]; [ii,jj]=unique(B,'stable'...

13 years ago | 0

Answered
Find elements of an array in another array
Maybe in your case, all element in A are present in B A=[1 2 3 4 5 6 7] B=[12 13 2 4 3 2 4 2 25 1 6 7 5] pos=arrayfun(@(...

13 years ago | 0

| accepted

Answered
use the "subs" command to subsitute equations for a variable
syms x a y=2*(2*x-1); subs(y,a)

13 years ago | 0

Answered
Managing alot of variables (time series)
You can use a cell array. For example y={[1;2;3;4], [2;6;8], [0;1;0;0;1;0;1]} for k=1:numel(y) v=y{k} m{k}=mea...

13 years ago | 1

| accepted

Answered
system of linear equations but with condtions that all variables should be > 0
For a system A*x=b the solution is x=A\b

13 years ago | 0

Load more