Respondida
good evening , iam getting error as (im2jpeg(x, quality) Error using im2jpeg (line 21) The input must be a UINT8 image) at line 21 . how can i resolve it in the below code
The problem isn't in the code in the function, it's in what you're passing to it as an input image. The function is written to ...

más de 9 años hace | 0

Respondida
How do I label the grouped horizontal bars in MATLAB?
I don't have HG2 so can't test and the solution to find the bar positions that worked with HG1 does _not_ work with HG2. Contri...

más de 9 años hace | 0

Respondida
Plot data with time in miliseconds
>> fmt='yyyy-MM-dd HH:mm:ss.SSS'' >> dtn=datetime('2017-06-12 13:46:31.486','Inputformat',fmt) dtn = 12-Jun-2017 13:4...

más de 9 años hace | 1

| aceptada

Respondida
Find value in matrix that matches calculation
|*==*| is an exact match to the LSB if these values are differing in some decimal position then eledata = (data(2:end,4))=...

más de 9 años hace | 2

| aceptada

Respondida
Fitting my parametric function to experimental data from excel.
Use the custom |*fittype*| to define the equation and the |*fit*| with it.. pf_eqn = fittype('p1^a + p2^b + p3^c + p4^d+ p5...

más de 9 años hace | 0

Respondida
Fitting data for each row of a matrix
Guessing the intent Stephen has asked for, x=1:8; % the independent variable vector nrow=size(dat...

más de 9 años hace | 0

Respondida
Matlab Table / Dataset type optimization
_"Matrix is very fast, [but] you can't always remember variable name by column index."_ If speed is the goal, you can't beat ...

más de 9 años hace | 1

Respondida
Delete Empty Rows in a Cell Array
[~,~,raw]=xlsread('StimuliInExcel.xlsx', 'WilliamsList'); raw=raw(~all(cellfun(isempty,raw),2),:); xlswrite('StimuliInEx...

más de 9 años hace | 0

Respondida
Change x-axis label font size?
See <http://www.mathworks.com/help/matlab/ref/numericruler-properties.html <numeric ruler properties>>. Have to have HG2 (R2014...

más de 9 años hace | 0

Respondida
How to clear a variable if "clear" is itself a variable?
See previous poster's dilemma resolved at <https://www.mathworks.com/matlabcentral/answers/35475-overwrote-clear-function?s_tid=...

más de 9 años hace | 1

| aceptada

Respondida
Difference linear regression / linear solver
As commented above, if given same problem, all return same result-- >> x=1:10;y=x+rand(size(x)); >> b=polyfit(x,y,1) b ...

más de 9 años hace | 0

Respondida
Why does fit curve extend longer than data?
# Evaluate |yhat=model(x)| explicitly at the points desired in vector _x_, or # Retrieve the _[X|Y]Data_ arrays from the figure...

más de 9 años hace | 0

Respondida
Running the bat file
When the new process is spawned, it inherits default environment (PATH and other variables). If python isn't installed on that ...

más de 9 años hace | 0

| aceptada

Respondida
Need help with loops
Rewriting the above to compute for any number of bets would seem simplest-- function [stat,mxIdx] = bestbets(odds) % ret...

más de 9 años hace | 0

| aceptada

Respondida
How to add more variables in script function file....
Just as confirmation you really, really, really don't want to do this, I took the above first 16 terms portion of the expression...

más de 9 años hace | 1

Respondida
How to add more variables in script function file....
Why in the world would you even attempt to write every element out explicitly for 1200 terms???? Pass the coefficients as well....

más de 9 años hace | 1

Respondida
How can I read in data and sparse each column into vectors with the saved variable name?
Try the newer |*table*| class... data=readtable('asec_swrat_80_16_diff.csv'); See doc table % and read _concept...

más de 9 años hace | 0

| aceptada

Respondida
"To RESHAPE the number of elements must not change" error during plot
"S4(t)" is symbolic and a (very) long character expression whereas "t" is double vector. *plot* is trying to turn them both int...

más de 9 años hace | 0

| aceptada

Respondida
How to write a mixed data (text and number) in a CSV file ?
It seems like "'round Robin Hood's barn!" way to get there, but believe it or not, fname='yourfile.csv'; writetable(cell...

más de 9 años hace | 2

Respondida
extracting data from text file
>> 27*3500*8/1024/1024 ans = 0.7210 MB >> Isn't all that big by today's standards. Just read the file and do whatev...

más de 9 años hace | 0

Respondida
How can a make a matrix which keeps on updating itself and after the loop is over its saves it as a cvs file?
coefficients=zeros(100,9); % preallocate for k=1:100 % stylistic hint: use variables ...

más de 9 años hace | 0

| aceptada

Respondida
creating array of fix and changing variables for xlswrite export
>> [{' '} col_header] ans = ' ' 'Col1' 'Col2' 'Col3' 'Col4' 'Col5' >> You've added a blank column t...

más de 9 años hace | 0

Respondida
Controlling format (number of decimals) of specific ticks
figure hAx=axes; xtklab=get(hAx,'xticklabel'); xtklab{1}='0.000'; set(hAx,'xticklabel',xtklab) results in <...

más de 9 años hace | 0

| aceptada

Respondida
Excel Bubble Chart Code
pt=PulleyTable; % shorten the name... scatter(pt.X,pt.Y,pt.D.^2/6,'filled') xlim([-400 400]), ylim([-50 250]) grid o...

más de 9 años hace | 0

| aceptada

Respondida
Plot normal distribution that range from -1 to 1
Well, per the comment, you can't have both...try x=linspace(-1,1); plot(x,normpdf(x,0,1/3.5)) You can adjust the divi...

más de 9 años hace | 0

| aceptada

Respondida
Annotation with fraction and upright Greek letters
Try annotation('textbox',[0.2,0.6,0.1,0.1],'String','$$\frac{\Delta - \Gamma}{\delta}$$','interpreter','latex') and mess...

más de 9 años hace | 0

Respondida
How to scale y-axes in subplots so that the length of one data unit is equal between the different subplots.
Basically Adam's comment as Answer with a little detail... for i=1:3 hAx(i)=subplot(1,3,i); % create the plot cod...

más de 9 años hace | 0

| aceptada

Respondida
How can I concate two datatime and two double format arrays into one table, and use the array names as the titles?
Presuming the all have the same number of rows (a requirement for a table), then overallMaxTq = table(overallTqMaxTime1A,ov...

más de 9 años hace | 0

Respondida
How to transform a 1d vector of multiple elements to 1 element?
Try Jan's most-excellent FEX submission <https://www.mathworks.com/matlabcentral/fileexchange/31272-datahash <datahash>>

más de 9 años hace | 0

Cargar más