Answered
How do you continue a string on the next line in Psychtoolbox?
The strings, 'center', 'center', are they really intended to be part of the second input argument of DrawFormattedText() ? I g...

1 month ago | 0

| accepted

Answered
Invalid default value for property error in class properties
In the properties block one must refer to a as MyClass.a when Constant. >> mc = MyClass mc = MyClass with properties: ...

1 month ago | 0

| accepted

Answered
NetCDF File Assign Variable Loop from Array
Partial answer. Replace ? = ncread('../data/isff_20070403_20.nc',fNameu); by assign( txt, ncread('../data/isff_20070403_20.nc...

1 month ago | 0

| accepted

Answered
How do I convert a string to date time?
I found this example in the documentation of datetime Specify the current date and time in the time zone represented by Seoul, ...

1 month ago | 0

Answered
How can I extract a single value from every 86 lines of a long text file?
Try this %% Read all lines as text fid = fopen( 'fort18000.txt' ); cac = textscan( fid, '%s', 'Delimiter','\n' ); [~] = fclo...

1 month ago | 0

| accepted

Answered
how to extract a specific data from struct formatted dataset
Try this %% z = load('B0005.mat'); len = length(z.B0005.cycle); a = zeros( len, 1 ); for ii = 1:len if strcmp( z.B00...

1 month ago | 0

| accepted

Answered
Matlab does not save the variable in each loop
you need to pre-allocate Tout, something like N = appropriate value Tout = cell(1,N); before assigning values

2 months ago | 1

| accepted

Answered
This code is not working, it return an issue stating with vector length, please help out
The size of the variables, x2 and w, must be the same. They are not. >> whos x1 v x2 w Name Size Bytes Cla...

2 months ago | 0

Answered
How can I find x values given a FOR command?
Replace find (x) = 0:5:55 by x(1:round(5/dt):end,:) This should work since 5/dt is a whole number. round takes care of a po...

2 months ago | 1

| accepted

Answered
Saving and opening Matlab file
"Except the plot dosen't show" Matlab doesn't recognise it as Matlab code. The extension, .mat, indicates data. See Save and...

2 months ago | 0

| accepted

Answered
Search through every vector in cell array for the vector that contains a certain value
Try this %% nodey = {[1,2],[3,4]}; %% has_one = false(1,length(nodey)); for ii = 1:length(nodey) has_one(ii) = ismembe...

2 months ago | 0

| accepted

Answered
how to get answer from tic tok command that stays on the screen
Replace toc by elapsed_time = toc; which saves the elapsed time iin the variable, elapsed_time. And add elapsed_time af...

2 months ago | 0

| accepted

Answered
convert to integer numbers
There are four different functions, which round to whole numbers round Round to nearest decimal or integer ceil Round towa...

2 months ago | 0

| accepted

Answered
Display a new matrix
This should do it: >> p=1; >> [A(1:p,:),B(1:p,:)] ans = 1 2 3 4 0 >> p=2; >> [A(1:p,:),B(1:p,:)] ans...

2 months ago | 0

| accepted

Answered
Add element to a given vector
One way >> x = 1:6 x = 1 2 3 4 5 6 >> x(end+1)=17 x = 1 2 3 4 5 6 17 ...

2 months ago | 0

| accepted

Answered
Undefined function 'equation' for input arguments of type 'double'
This is my guess function x = equation( M, epsilon, tol ) h = 1e-8; x = pi/6; % first guess foo = @(x) M+epsil...

2 months ago | 0

Answered
Extracting Data field of a Series in HTML file
I misunderstood your question. This is a bit of overkill. Assumptions the string, series:, always indicates the start of a blo...

2 months ago | 0

| accepted

Answered
DataStore function returns an error
I use R2018b >> version ans = '9.5.0.944444 (R2018b)' The example of the help on datastore works as expected in the ...

2 months ago | 0

Answered
Hello, I want to merge a big matrices row by row
Try this >> m1=ones(3,3); >> m2=2*ones(3,3); >> M = nan( 6, 3 ); >> M(1:2:end,:)=m1; >> M(2:2:end,:)=m2; >> M M = 1...

2 months ago | 0

| accepted

Answered
Why is there a syntax error for my code?
I don't think the problem is with your code, but rather with the users input. input( 'Please input ... ' ) expects an expression...

2 months ago | 0

Answered
How to vectorize string/char array concatenation with 'newline' characters for fprintf?
This statement should do it xmlOutString = strjoin( xmlData, '\n' );

2 months ago | 1

| accepted

Answered
read ASCII data with varying lengths of space as delimiters
subset.txt is a fixed-width text file. No doubt about that. Since R2018b (R2017a?) it is straight forward to read fixed-width t...

2 months ago | 0

Answered
How to avoid Matlab inbuilt functions when executing F11 command to understand the code step by step?
"Is there any way to avoid the matlab inbuilt functions?" Alternately use F11 and F10. I guess it's possible to write a condit...

2 months ago | 0

Answered
Finding odd and even values without functions
Try this >> a=1:12 a = 1 2 3 4 5 6 7 8 9 10 11 12 >> (-1).^[a]==1 ans = 1×...

2 months ago | 1

Answered
textread() for Importing Values into Multi-Column Matrices
"is there were a way to specify that the output of the textread" See textscan, 'CollectOutput', true "Is this possible with t...

2 months ago | 0

Answered
Write/read binary files
This script %% ffs = 'test.bin'; X = 1+2i; %% write codes fid = fopen(ffs,'w','ieee-be'); tmpdatR = real((X)); tmpdatI ...

2 months ago | 0

Answered
How to know which toolboxes i am implementing
See matlab.codetools.requiredFilesAndProducts and How to list all function dependencies in v2016

2 months ago | 0

Answered
How to plot a 3 dimensional array
See 2-D and 3-D Plots

2 months ago | 0

Answered
why does matlab tell me that the "chop" command doesn't exist?
Make sure that you have the Control System Toolbox. chop() is a function in that toolbox. >> product_info = ver('control') pro...

2 months ago | 1

| accepted

Answered
How can I sum the elements in a vector row without using the sum function or any form of loops?
This is one way >> vec = (1:12); >> vec*ones(12,1) % replace '12' by length(vec) ans = 78 and check if that's the corre...

2 months ago | 2

Load more