Réponse apportée
Use of nargin and varargin
It's a bit of a challenge to make this program correct easy to maintain user friendly (I assume that you really need all...

plus de 6 ans il y a | 2

| A accepté

Réponse apportée
save figure as filename that I already have
Q1: I've learned the hard way not to mess with legend(). Thus, I pass this one. Q2: Here is a hint. Run this script on...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
How can i fix ' Unable to perform assignment because the left and right sides have a different number of elements.' in the loop functions ?
One thing is to make a code run without throwing errors, another is to make it produce the intended result. Replacing omega3 b...

plus de 6 ans il y a | 0

Réponse apportée
Extracting consecutive digits using regexp
These two returns "123" %% cac = regexp('ITEM 123', '.+?(\d+)', 'tokens' ) %% cac = regexp('ITEM 123', '[^\d]+(\d+)', 'token...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
How do I extract a number from a string?
Try this %%-section by section %% cac = { 123, 'U 2'; 'Mod3', 789 }; % Sample data %% isx = cellfun( @(chr) isa(chr,'char'),...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
How to create a vector with "n" random elements chosen from two values stated like "bit1" and "bit0"?
Try Fs = 100; y = randi( [0,1], 1,Fs ); y(y==0) = -1;

plus de 6 ans il y a | 0

Réponse apportée
problem in loading .mat file (Error using load)
On Win10, R2018b I have downloaded your two files from Box successfully dragged the 'Util_Tgt0.7_SC7_dr0.07_20181111_test2_Fi...

plus de 6 ans il y a | 0

Réponse apportée
MatLAB gives NaN result on simple loop
"where the f2 is always not equal to f1" My steps set dbstop if naninf started your script execution halted at line 77, z3 =...

plus de 6 ans il y a | 0

Réponse apportée
if statement with sub cases
Try %% text = 'Time = 16:0:16 Height'; %% num = sscanf( text, 'Time = %d:%d:%d Height' ); time = [ 60*60, 60, 1 ] * num;...

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
Using Textscan on non-uniform data
An exercise with fscanf() %% ffs = "HS_full_18md_nam_outputs.txt"; fid = fopen( ffs, 'r' ); [~] = fgetl( fid ); num = fsca...

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
Mismatch between file and format character vector but the CSV file contains only numerics?
dlmread() fails to read and convert quoted digits, e.g. "123","456","789". Neither does csvread(). See Comma-separated values....

plus de 6 ans il y a | 4

| A accepté

Réponse apportée
How can I use a specified order of strings to index from a cell array?
Run section by section %% deg_baseFileName = "Test1_female_44k_70dBA_babble7ch_1sp_20k_00dBA_48k"; %% deg_parts = strsplit(d...

plus de 6 ans il y a | 1

Réponse apportée
Loading Large .txt files
You didn't say how much physical memory is in your system. Matlab provides ways to handle large text files, Large Files and Bi...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
serveral normrnd without a loop
What about this? >> cell2mat( arrayfun( @(m,l) normrnd( m, sig, [1,l] ), mu, len, 'uni',false ) ) ans = Columns 1 through ...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
How can I run a matlab program N times using a different value of one of my variables
Assumptions: You have a script. Lets call it myScript. The first line of myScript is clear all Near the top of myScript the...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
How to remove \n and empty line after combine all the lines into an array
Replace fgets by fgetl fgetl, Read line from file, removing newline characters In response to comment To remove the endi...

presque 7 ans il y a | 1

| A accepté

Réponse apportée
Replace numbers into a vector starts at the center? Looking for general format
Run this %% vec = [ 0 0 0 0 0 ]; vec1 = [ 1 1 1 ]; new_vec = [ 0 1 1 1 0 ]; %% len = length( vec ); len...

presque 7 ans il y a | 1

| A accepté

Réponse apportée
index exceeds matrix dimensions
Your profile shows that you over the last few months have posed ten questions in this forum and not received a single answer. Ar...

presque 7 ans il y a | 1

| A accepté

Réponse apportée
Loop is running only for certain value in the whole range
I'm not a fan of backward engineering of faulty code. The formula of one of your comments is the formula of a moving average. Ma...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
Using Property Blocks : Set/get on properties within a single property block
The problem is obviously to implement 'block','Data'. Try this >> myc = myClass myc = myClass with properties: na...

presque 7 ans il y a | 1

| A accepté

Réponse apportée
Class with dynamic properties but no handle
"like a stupid thing to ask" No that's definately a good question that deserves an answer. "how do I go from a handle class t...

presque 7 ans il y a | 1

| A accepté

Réponse apportée
Determine The Input Time with tic,toc
I assume that hObject is a uicontrol object of style edit. Your current script reads the elapse time of getting the current st...

presque 7 ans il y a | 1

| A accepté

Réponse apportée
Import .mat files and arrange some data in a matrix
Set Pause on Errors and run again Next see: Debug a MATLAB Program and Examine Values While Debugging

presque 7 ans il y a | 0

| A accepté

Réponse apportée
How to inherite and intialize object values
"How do I inherit inputDef in a another class such that [...]" See Composition over inheritance and try %% in = inputDef()...

presque 7 ans il y a | 0

Réponse apportée
Replace the elements of a matrix
One way z = permute( A, [2,1] ); B = z(:); or z = permute( A, [2,1] ); B = reshape( z, [],1 );

presque 7 ans il y a | 0

| A accepté

Réponse apportée
Error in fprintf function
"Invalid file identifier. Use fopen to generate a valid file identifier". The problem is most likely with this line fid = fopen...

presque 7 ans il y a | 1

| A accepté

Réponse apportée
From cell to matrix
One way %% cac = { [5,6],[5,12],[6,12] ; [7,11],[],[] ; [18,19],[],[] }; % your sample data ise = cellfun( @isempty, cac ); ...

presque 7 ans il y a | 0

Réponse apportée
Table values that is a scalar string
On my system Win10, R2018b, Excel 2016 all the methods to reference the last column works. (I downloaded AA.xlsx from another qu...

presque 7 ans il y a | 0

Réponse apportée
Question with for loop 'Index in position 1 exceeds array bounds (must not exceed 9)'
Line 9 arcStraight(ii,jj)=distance('rh',lats(ii,jj), lons(ii,jj),lats(ii+1,jj),lons(ii+1,jj),referenceEllipsoid(7030)); conta...

presque 7 ans il y a | 1

| A accepté

Réponse apportée
How to read only the first term on the file.
Try this %% ffs = 'h:\m\cssm\force.dat'; % change to your folder fid = fopen( ffs, 'r' ); cac = textscan( fid, '%*f%s%*s%*s'...

presque 7 ans il y a | 1

| A accepté

Charger plus