A résolu


Find all elements less than 0 or greater than 10 and replace them with NaN
Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...

plus de 13 ans il y a

A résolu


Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

plus de 13 ans il y a

A résolu


Add two numbers
Given a and b, return the sum a+b in c.

plus de 13 ans il y a

A résolu


Times 2 - START HERE
Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

plus de 13 ans il y a

Réponse apportée
How to plot data after being selected in Excel
what command are you using to import the data from Excel? Cant you just import them into your workspace and then specify the var...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
Large structures won't save
I doubt that MATLAB is out of memory. You are probable just saving the data incorrectly. Look at <http://www.mathworks.com/m...

plus de 13 ans il y a | 0

Réponse apportée
simple question
using ChangesN = find(diff(S)) would demonstrate where the value was changing and then to see how many time this happen...

plus de 13 ans il y a | 1

| A accepté

Réponse apportée
question with correlation
Not sure what you are asking, but this may help. a = 1; b = 20; data = a + (b-a).*rand(20,4); R = corrcoef(data); ...

plus de 13 ans il y a | 0

| A accepté

Question


find repeating numbers
What is the best method to find the numbers in an array which repeat most frequently. For example, say that I have a matrix of v...

plus de 13 ans il y a | 3 réponses | 0

3

réponses

Réponse apportée
error using fopen
what about: a = [6,7]; filename = 'E:\test.txt'; fid = fopen(filename,'wt'); fprintf(fid,'%g\t%g',a); fclose(fi...

presque 14 ans il y a | 0

Réponse apportée
TXT export
This code may give you some ideas: clear all a = 1; b = 20; data = a + (b-a).*rand(100,4); Heading = {'Data'}; ...

presque 14 ans il y a | 0

Réponse apportée
TXT export
I would suggest using fprintf instead of dlmwrite: <http://www.mathworks.co.uk/help/techdoc/ref/fprintf.html> In order to ...

presque 14 ans il y a | 0

Réponse apportée
problem in solving code for arrehenius equation,To and Ta are in kelvin
in your loop what is 'l' suppose to be? Your stating that your loop goes from 1 to 'l' but haven't specified what 'l' is. Fro...

presque 14 ans il y a | 0

Réponse apportée
2D plot
Are you thinking of something like this? clear all x=[1,2,3,4]; y=[-1,2,-3,-4]; strValues = num2str([x(:) y(:)],...

presque 14 ans il y a | 0

| A accepté

Question


removing for loop by using cellfun
Could anyone provide information on how to remove the for loop from this line of script: for i =1:length(Name); Data...

presque 14 ans il y a | 1 réponse | 0

1

réponse

Réponse apportée
How to exclude more than 1 columns from a matrix?
simple way would be: Data(:,3) = []; Data(:,5) = [];

presque 14 ans il y a | 0

| A accepté

Réponse apportée
How could I get a smooth curve by "plot" function?
you could use the smoothLine function from the file exchange: <http://www.mathworks.com/matlabcentral/fileexchange/9369-smoot...

presque 14 ans il y a | 0

Question


Improving matlab skills
What is the best way of improving my matlab skills? I have been using matlab for some months now and have learnt a lot in that t...

presque 14 ans il y a | 2 réponses | 1

2

réponses

Question


significant correlation values
How is it possible to test whether the correlation between 2 time series is significant? For example: clear all a = 1...

presque 14 ans il y a | 1 réponse | 0

1

réponse

Question


convert Julian day to month
Consider the following: clear all depths = 1:1:12; temp = 0 + (20-0).*rand(8760,12); DateTime = datenum('2011-01-0...

presque 14 ans il y a | 1 réponse | 0

1

réponse

Question


change interval for xtick label
Consider the following example: clear all x = (0:23).'; n = numel(x); time = cellstr(datestr([ones(n,1)*[2012 3 1...

presque 14 ans il y a | 1 réponse | 0

1

réponse

Réponse apportée
Simple but elusive array question
should your question be like 'a' below? clear all a = [1,1,3;2,0,4;3,0,0;0,0,0]; b = arrayfun(@find,a,'un',0); If ...

presque 14 ans il y a | 0

Question


tick marks in boxplot
close all fh = figure(1); boxplot(data,time,'colors','k','jitter',1,'medianstyle','line',... 'whisker',...

presque 14 ans il y a | 1 réponse | 1

1

réponse

Réponse apportée
changing text orientation of lcolorbar
Im not sure if this answers your question but if you want to rotate the text by the colorbar (as noted above): c = colorbar...

presque 14 ans il y a | 0

Question


vectorizing a script with cellfun
I'm aiming to import data from various folder and text files into matlab. clear all main_folder = 'E:\data'; %D...

presque 14 ans il y a | 3 réponses | 0

3

réponses

Réponse apportée
xlsread and fwrite: remove unwanted single quotes from strings
The quotes just mean that it is a string. If you type something like stringcountry{1} it should provide the name of the countr...

presque 14 ans il y a | 0

| A accepté

Réponse apportée
Finding value behind string
Couldn't you import all of the text file into matlab using textscan and then select the appropriate fields afterwards? It may pr...

presque 14 ans il y a | 0

| A accepté

Réponse apportée
cells related
pre-allocate memory first, this may speed it up. <http://www.mathworks.co.uk/help/techdoc/matlab_prog/f8-784135.html> ...

presque 14 ans il y a | 0

Réponse apportée
Retrieve data from Hard Drive (Local Directory)
I would think that you need to use the dir command. If the files are located in your C drive then: clear all TopFolder =...

presque 14 ans il y a | 0

| A accepté

Question


plotting data which extends several years
Consider the following example: clear all time_2007 = linspace(1+0.0417, 366, (366-1)*24); time_2008 = linspace(1+0...

presque 14 ans il y a | 1 réponse | 0

1

réponse

Charger plus