Answered
Creating a loop for several excel files with several sheets
folder='C:\\Users\emma\Documents\CORES\EXCEL'; ff='SAFLCore*_GrainSize.xlsx' names=dir(fullfile(folder,ff) filename = {name...

9 years ago | 0

| accepted

Answered
Gathering excel files over months
d=now [~,m]=month(d) y=year(d) if ~isdir(m) % Test if the foldr exist f=[ m num2str(y)] mkdir(f) % Create a ne...

9 years ago | 0

Answered
Index issue with using a global variables that are vectors in a function
Why are you using global? you can simply write function TH=THETA(y, z,qv,dv); TH=qv(y) + z*((qv(y))^2)/(1 - (dv(y))*z); ...

9 years ago | 0

| accepted

Answered
select row and iterate for next rows
A=randi(100,100,4) [n,m]=size(A) for k=1:n % loop each row r=A(k,:) % get the kth row % Do end

9 years ago | 0

| accepted

Answered
conversion of hexadecimal timestamps
use hex2dec command a='10' b=hex2dec(a)

9 years ago | 0

Answered
How to use matrix elements as indices to access elements of another matrix
Values(:,:,1) = [0 0 1 2 2 2 1 1 2 1 0 0 1 1 2 1 2 1 2 2] Values(:,:,2) = [1 0 1 2 2 0 2 1 ...

9 years ago | 0

| accepted

Answered
Is it possible to plot a cell array on y axis (imagesc function)
Use Yticklabel instead of ytick set(gca, 'YTicklabel',{'AU1','AU1-2','aa' })

9 years ago | 0

| accepted

Answered
how to control a simulink block through mfile?
Use set_param fucntion <http://www.mathworks.com/help/simulink/slref/set_param.html> To update your simulink model use ...

9 years ago | 0

Answered
Double the resolution of a vector
a=[0 2 5 10 12] b=sort([a a(1:end-1)+diff(a)/2]) You can also use interp1 function a=[0 2 5 10 12] b=interp1(1:...

9 years ago | 0

| accepted

Answered
Linestyle does not change
Increase the line width t=0:0.1:10 r1=sin(t) r2=2*cos(t) r3=t plot(t,r2,'--b');hold on plot(t,r3,'-.r','linewidth',3);...

9 years ago | 0

Answered
How to import timestamp from excel
If your time vector is in the first column for example [a,b,c]=xlsread('d1.xlsx') out=datestr(a(:,1),'HH:MM:SS')

9 years ago | 1

| accepted

Answered
How do I write, while using XLSWRITE to capture a column matrix at particular column of excel file.
A=randi(10,10,1) xlswrite('fic1.xlsx',A,'B:B')

9 years ago | 0

Answered
Fastest way to cycle through a structure for a number
s(1).val = 50 s(2).val = 47 s(3).val = 22 find([s(:).val]==50)

9 years ago | 0

Answered
How to make character String
str='the quick brown fox jumps over the lazy dog' out=strsplit(str) strsplit was introduced in R2013a If your Matlab ve...

9 years ago | 1

| accepted

Answered
xlswrite and xlsread is not working on Matlab R2015b, August 20, 2015, License 326XXXX, 64 bit on HP laptop
Maybe you are trying to create a file in an unauthorized folder like : C:\Program Files\MATLAB\R2016a\bin change your current f...

9 years ago | 0

Answered
how to convert char to array of string?
name_final = {'PECCalc_tqElFil2_VW_173','PECCtl_bDampCtl_VW_173'} out=regexp(name_final,'.+(?=.{4})','match','once')

9 years ago | 0

| accepted

Answered
How to solve linear system equations Ax=b but b is vector of variables
syms r1 r2 r3 b=[r1+r2;r3+3*r3;r1+9*r1] A=randi(3,3) x=A\b

9 years ago | 1

Answered
How to give name to cell in variables column?
columnname=genvarname(repmat({'col'},1,12),'col') %or columnname={'a','b','c','d'}

9 years ago | 1

Answered
How to vectorize the following code?
v={'Adana','Adıyaman','Afyon','Ağrı','Amasya'} sehirName = {'Ağrı';'Ağrı';'Ağrı';'Amasya';'Amasya';'Amasya';'Amasya';'Adana'}...

9 years ago | 0

| accepted

Answered
How can I extract line numbers of text data?
str=[] fid=fopen('portion.txt') l=fgetl(fid) while ischar(l) str{end+1,1}=l; l=fgetl(fid); end fclose(fid) str...

9 years ago | 1

| accepted

Answered
How to edit a particular row of a particular column of .dat file ?
fid=fopen('filename.dat') d=textscan(fid,'%s %f %f %f') fclose(fid) M=cell2mat(d(:,2:4)) %Or [a,b,c,d]=textread...

9 years ago | 0

Answered
Use Simulink (MATLAB) to simulate the following systems then show and plot the step response of the system. 1. 4
<http://www.mathworks.com/videos/getting-started-with-simulink-69027.html> For your problem look at this link <http://blogs....

9 years ago | 0

Answered
I want to read number from the file, but there are several sentences in the first 5 lines, just want to read the number from the 6th line to the last line
for k=1:1000 fid=fopen(sprintf('%d.txt',k)) d{k}=textscan(fid,'%f','headerlines',5) fclose(fid) end out=cell2...

9 years ago | 0

Answered
find function exceeds matrix dimensions?
Depending on what you want, if the two columns should be equal to nan hh1 = hh1(~all(isnan(hh1(:,19:20)),2),:) %or if a...

9 years ago | 0

| accepted

Answered
How to connect simulink model and genetic algorithm in matlab?
Use Matlab Function Block <http://www.mathworks.com/help/simulink/slref/matlabfunction.html>

9 years ago | 1

Answered
How can I display images from image names in a matrix?
[numbers,imagenames]=xlsread('filename.xlsx') for k=1:numel(imagenames) images{k}=imread(imagenames{k}) end

9 years ago | 0

Answered
create a randomised vector from matrix
A=reshape(1:37*8,37,8) % Example [n,m]=size(A) idx=cell2mat(arrayfun(@(x) randperm(n)', 1:m,'un',0)') idy=zeros(size(idx))...

9 years ago | 0

Answered
Assign Cell Array to singe variable
This is not recommended. Read this <http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3...

9 years ago | 0

Answered
Associate an array to every element of a matrix
Use cell array. For example M={ [1 2 3] [1 2] [4 5;6 5] 'abc' [ ] }

9 years ago | 1

Answered
How can I change the name of a variable?
Read this <http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F> you will know that it...

9 years ago | 0

Load more